diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/Az.DeviceRegistry.format.ps1xml b/generated/DeviceRegistry/DeviceRegistry.Autorest/Az.DeviceRegistry.format.ps1xml index 216278404339..127287dcb7fa 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/Az.DeviceRegistry.format.ps1xml +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/Az.DeviceRegistry.format.ps1xml @@ -835,182 +835,6 @@ - - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.CertificateAuthorityConfiguration - - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.CertificateAuthorityConfiguration#Multiple - - - - - - - - - - - - - - - - - - - - - KeyType - - - Subject - - - ValidityNotAfter - - - ValidityNotBefore - - - - - - - - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.Credential - - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.Credential#Multiple - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Location - - - Name - - - SystemDataCreatedAt - - - SystemDataCreatedBy - - - SystemDataCreatedByType - - - SystemDataLastModifiedAt - - - SystemDataLastModifiedBy - - - SystemDataLastModifiedByType - - - ResourceGroupName - - - - - - - - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.CredentialListResult - - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.CredentialListResult#Multiple - - - - - - - - - - - - NextLink - - - - - - - - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.CredentialProperties - - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.CredentialProperties#Multiple - - - - - - - - - - - - ProvisioningState - - - - - - - - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.CredentialUpdateTags - - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.CredentialUpdateTags#Multiple - - - - - - - - - - - - Item - - - - - - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.DataPoint @@ -1201,28 +1025,6 @@ - - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.DeviceCredentialPolicy - - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.DeviceCredentialPolicy#Multiple - - - - - - - - - - - - ResourceId - - - - - - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.DeviceMessagingEndpoint @@ -1369,9 +1171,6 @@ - - - @@ -1418,9 +1217,6 @@ OperationId - - PolicyName - ResourceGroupName @@ -1933,50 +1729,6 @@ - - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.LeafCertificateConfiguration - - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.LeafCertificateConfiguration#Multiple - - - - - - - - - - - - ValidityPeriodInDay - - - - - - - - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.LeafCertificateConfigurationUpdate - - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.LeafCertificateConfigurationUpdate#Multiple - - - - - - - - - - - - ValidityPeriodInDay - - - - - - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ManagementAction @@ -4401,142 +4153,6 @@ - - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.Policy - - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.Policy#Multiple - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Location - - - Name - - - SystemDataCreatedAt - - - SystemDataCreatedBy - - - SystemDataCreatedByType - - - SystemDataLastModifiedAt - - - SystemDataLastModifiedBy - - - SystemDataLastModifiedByType - - - ResourceGroupName - - - - - - - - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.PolicyListResult - - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.PolicyListResult#Multiple - - - - - - - - - - - - NextLink - - - - - - - - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.PolicyProperties - - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.PolicyProperties#Multiple - - - - - - - - - - - - ProvisioningState - - - - - - - - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.PolicyUpdateTags - - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.PolicyUpdateTags#Multiple - - - - - - - - - - - - Item - - - - - - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ProxyResource diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/Az.DeviceRegistry.psd1 b/generated/DeviceRegistry/DeviceRegistry.Autorest/Az.DeviceRegistry.psd1 index 5d279cfc37e3..3508e6e00177 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/Az.DeviceRegistry.psd1 +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/Az.DeviceRegistry.psd1 @@ -11,7 +11,7 @@ DotNetFrameworkVersion = '4.7.2' RequiredAssemblies = './bin/Az.DeviceRegistry.private.dll' FormatsToProcess = './Az.DeviceRegistry.format.ps1xml' - FunctionsToExport = 'Get-AzDeviceRegistryAsset', 'Get-AzDeviceRegistryAssetEndpointProfile', 'Get-AzDeviceRegistryBillingContainer', 'Get-AzDeviceRegistryCredentials', 'Get-AzDeviceRegistryNamespace', 'Get-AzDeviceRegistryNamespaceAsset', 'Get-AzDeviceRegistryNamespaceDevice', 'Get-AzDeviceRegistryNamespaceDiscoveredAsset', 'Get-AzDeviceRegistryNamespaceDiscoveredDevice', 'Get-AzDeviceRegistryPolicy', 'Get-AzDeviceRegistrySchema', 'Get-AzDeviceRegistrySchemaRegistry', 'Get-AzDeviceRegistrySchemaVersion', 'Move-AzDeviceRegistryNamespace', 'New-AzDeviceRegistryAsset', 'New-AzDeviceRegistryAssetEndpointProfile', 'New-AzDeviceRegistryCredentials', 'New-AzDeviceRegistryNamespace', 'New-AzDeviceRegistryNamespaceAsset', 'New-AzDeviceRegistryNamespaceDevice', 'New-AzDeviceRegistryNamespaceDiscoveredAsset', 'New-AzDeviceRegistryNamespaceDiscoveredDevice', 'New-AzDeviceRegistryPolicy', 'New-AzDeviceRegistrySchema', 'New-AzDeviceRegistrySchemaRegistry', 'New-AzDeviceRegistrySchemaVersion', 'Remove-AzDeviceRegistryAsset', 'Remove-AzDeviceRegistryAssetEndpointProfile', 'Remove-AzDeviceRegistryCredentials', 'Remove-AzDeviceRegistryNamespace', 'Remove-AzDeviceRegistryNamespaceAsset', 'Remove-AzDeviceRegistryNamespaceDevice', 'Remove-AzDeviceRegistryNamespaceDiscoveredAsset', 'Remove-AzDeviceRegistryNamespaceDiscoveredDevice', 'Remove-AzDeviceRegistryPolicy', 'Remove-AzDeviceRegistrySchema', 'Remove-AzDeviceRegistrySchemaRegistry', 'Remove-AzDeviceRegistrySchemaVersion', 'Sync-AzDeviceRegistryCredentials', 'Update-AzDeviceRegistryAsset', 'Update-AzDeviceRegistryAssetEndpointProfile', 'Update-AzDeviceRegistryCredentials', 'Update-AzDeviceRegistryNamespace', 'Update-AzDeviceRegistryNamespaceAsset', 'Update-AzDeviceRegistryNamespaceDevice', 'Update-AzDeviceRegistryNamespaceDiscoveredAsset', 'Update-AzDeviceRegistryNamespaceDiscoveredDevice', 'Update-AzDeviceRegistryPolicy', 'Update-AzDeviceRegistrySchema', 'Update-AzDeviceRegistrySchemaRegistry', 'Update-AzDeviceRegistrySchemaVersion' + FunctionsToExport = 'Get-AzDeviceRegistryAsset', 'Get-AzDeviceRegistryAssetEndpointProfile', 'Get-AzDeviceRegistryBillingContainer', 'Get-AzDeviceRegistryNamespace', 'Get-AzDeviceRegistryNamespaceAsset', 'Get-AzDeviceRegistryNamespaceDevice', 'Get-AzDeviceRegistryNamespaceDiscoveredAsset', 'Get-AzDeviceRegistryNamespaceDiscoveredDevice', 'Get-AzDeviceRegistrySchema', 'Get-AzDeviceRegistrySchemaRegistry', 'Get-AzDeviceRegistrySchemaVersion', 'Move-AzDeviceRegistryNamespace', 'New-AzDeviceRegistryAsset', 'New-AzDeviceRegistryAssetEndpointProfile', 'New-AzDeviceRegistryNamespace', 'New-AzDeviceRegistryNamespaceAsset', 'New-AzDeviceRegistryNamespaceDevice', 'New-AzDeviceRegistryNamespaceDiscoveredAsset', 'New-AzDeviceRegistryNamespaceDiscoveredDevice', 'New-AzDeviceRegistrySchema', 'New-AzDeviceRegistrySchemaRegistry', 'New-AzDeviceRegistrySchemaVersion', 'Remove-AzDeviceRegistryAsset', 'Remove-AzDeviceRegistryAssetEndpointProfile', 'Remove-AzDeviceRegistryNamespace', 'Remove-AzDeviceRegistryNamespaceAsset', 'Remove-AzDeviceRegistryNamespaceDevice', 'Remove-AzDeviceRegistryNamespaceDiscoveredAsset', 'Remove-AzDeviceRegistryNamespaceDiscoveredDevice', 'Remove-AzDeviceRegistrySchema', 'Remove-AzDeviceRegistrySchemaRegistry', 'Remove-AzDeviceRegistrySchemaVersion', 'Update-AzDeviceRegistryAsset', 'Update-AzDeviceRegistryAssetEndpointProfile', 'Update-AzDeviceRegistryNamespace', 'Update-AzDeviceRegistryNamespaceAsset', 'Update-AzDeviceRegistryNamespaceDevice', 'Update-AzDeviceRegistryNamespaceDiscoveredAsset', 'Update-AzDeviceRegistryNamespaceDiscoveredDevice', 'Update-AzDeviceRegistrySchema', 'Update-AzDeviceRegistrySchemaRegistry', 'Update-AzDeviceRegistrySchemaVersion' PrivateData = @{ PSData = @{ Tags = 'Azure', 'ResourceManager', 'ARM', 'PSModule', 'DeviceRegistry' diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/Properties/AssemblyInfo.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/Properties/AssemblyInfo.cs index 9ed6211508db..d4e4fc189b47 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/Properties/AssemblyInfo.cs +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/Properties/AssemblyInfo.cs @@ -20,8 +20,8 @@ [assembly: System.Reflection.AssemblyCopyrightAttribute("Copyright © Microsoft")] [assembly: System.Reflection.AssemblyProductAttribute("Microsoft Azure PowerShell")] [assembly: System.Reflection.AssemblyTitleAttribute("Microsoft Azure PowerShell - DeviceRegistry")] -[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0")] -[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0")] +[assembly: System.Reflection.AssemblyFileVersionAttribute("0.2.0")] +[assembly: System.Reflection.AssemblyVersionAttribute("0.2.0")] [assembly: System.Runtime.InteropServices.ComVisibleAttribute(false)] [assembly: System.CLSCompliantAttribute(false)] diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/exports/Get-AzDeviceRegistryAsset.ps1 b/generated/DeviceRegistry/DeviceRegistry.Autorest/exports/Get-AzDeviceRegistryAsset.ps1 index bfeae22ef746..f9dd2fcfde78 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/exports/Get-AzDeviceRegistryAsset.ps1 +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/exports/Get-AzDeviceRegistryAsset.ps1 @@ -49,7 +49,6 @@ INPUTOBJECT : Identity Parameter [Location ]: The name of the Azure region. [NamespaceName ]: The name of the namespace. [OperationId ]: The ID of an ongoing async operation. - [PolicyName ]: The name of the Policy tracked resource. [ResourceGroupName ]: The name of the resource group. The name is case insensitive. [SchemaName ]: Schema name parameter. [SchemaRegistryName ]: Schema registry name parameter. diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/exports/Get-AzDeviceRegistryAssetEndpointProfile.ps1 b/generated/DeviceRegistry/DeviceRegistry.Autorest/exports/Get-AzDeviceRegistryAssetEndpointProfile.ps1 index 210383b87366..bce68b43f375 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/exports/Get-AzDeviceRegistryAssetEndpointProfile.ps1 +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/exports/Get-AzDeviceRegistryAssetEndpointProfile.ps1 @@ -49,7 +49,6 @@ INPUTOBJECT : Identity Parameter [Location ]: The name of the Azure region. [NamespaceName ]: The name of the namespace. [OperationId ]: The ID of an ongoing async operation. - [PolicyName ]: The name of the Policy tracked resource. [ResourceGroupName ]: The name of the resource group. The name is case insensitive. [SchemaName ]: Schema name parameter. [SchemaRegistryName ]: Schema registry name parameter. diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/exports/Get-AzDeviceRegistryBillingContainer.ps1 b/generated/DeviceRegistry/DeviceRegistry.Autorest/exports/Get-AzDeviceRegistryBillingContainer.ps1 index ee604b0a37ec..c1f3c491639c 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/exports/Get-AzDeviceRegistryBillingContainer.ps1 +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/exports/Get-AzDeviceRegistryBillingContainer.ps1 @@ -50,7 +50,6 @@ INPUTOBJECT : Identity Parameter [Location ]: The name of the Azure region. [NamespaceName ]: The name of the namespace. [OperationId ]: The ID of an ongoing async operation. - [PolicyName ]: The name of the Policy tracked resource. [ResourceGroupName ]: The name of the resource group. The name is case insensitive. [SchemaName ]: Schema name parameter. [SchemaRegistryName ]: Schema registry name parameter. diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/exports/Get-AzDeviceRegistryCredentials.ps1 b/generated/DeviceRegistry/DeviceRegistry.Autorest/exports/Get-AzDeviceRegistryCredentials.ps1 deleted file mode 100644 index 57a1a6a56f95..000000000000 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/exports/Get-AzDeviceRegistryCredentials.ps1 +++ /dev/null @@ -1,236 +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 -Get a Credential -.Description -Get a Credential -.Example -Get-AzDeviceRegistryCredentials -NamespaceName my-namespace -ResourceGroupName my-resource-group -.Example -Get-AzDeviceRegistryNamespace -Name my-namespace -ResourceGroupName my-resource-group | Get-AzDeviceRegistryCredentials - -.Inputs -Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IDeviceRegistryIdentity -.Outputs -Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICredential -.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 - [AssetEndpointProfileName ]: Asset Endpoint Profile name parameter. - [AssetName ]: Asset name parameter. - [BillingContainerName ]: Name of the billing container. - [DeviceName ]: The name of the device. - [DiscoveredAssetName ]: The name of the discovered asset. - [DiscoveredDeviceName ]: The name of the discovered device. - [Id ]: Resource identity path - [Location ]: The name of the Azure region. - [NamespaceName ]: The name of the namespace. - [OperationId ]: The ID of an ongoing async operation. - [PolicyName ]: The name of the Policy tracked resource. - [ResourceGroupName ]: The name of the resource group. The name is case insensitive. - [SchemaName ]: Schema name parameter. - [SchemaRegistryName ]: Schema registry name parameter. - [SchemaVersionName ]: Schema version name parameter. - [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. -.Link -https://learn.microsoft.com/powershell/module/az.deviceregistry/get-azdeviceregistrycredentials -#> -function Get-AzDeviceRegistryCredentials { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICredential])] -[CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false)] -param( - [Parameter(ParameterSetName='Get', Mandatory)] - [Parameter(ParameterSetName='List', Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Path')] - [System.String] - # The name of the namespace. - ${NamespaceName}, - - [Parameter(ParameterSetName='Get', Mandatory)] - [Parameter(ParameterSetName='List', Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Path')] - [System.String] - # The name of the resource group. - # The name is case insensitive. - ${ResourceGroupName}, - - [Parameter(ParameterSetName='Get')] - [Parameter(ParameterSetName='List')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Path')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] - [System.String[]] - # The ID of the target subscription. - # The value must be an UUID. - ${SubscriptionId}, - - [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Path')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IDeviceRegistryIdentity] - # Identity Parameter - ${InputObject}, - - [Parameter()] - [Alias('AzureRMContext', 'AzureCredential')] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category('Runtime')] - [System.Management.Automation.SwitchParameter] - # Wait for .NET debugger to attach - ${Break}, - - [Parameter(DontShow)] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Runtime')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SendAsyncStep[]] - # SendAsync Pipeline Steps to be appended to the front of the pipeline - ${HttpPipelineAppend}, - - [Parameter(DontShow)] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Runtime')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SendAsyncStep[]] - # SendAsync Pipeline Steps to be prepended to the front of the pipeline - ${HttpPipelinePrepend}, - - [Parameter(DontShow)] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Runtime')] - [System.Uri] - # The URI for the proxy server to use - ${Proxy}, - - [Parameter(DontShow)] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Runtime')] - [System.Management.Automation.PSCredential] - # Credentials for a proxy server to use for the remote call - ${ProxyCredential}, - - [Parameter(DontShow)] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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 - - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } - - $context = Get-AzContext - if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit - } - - if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() - } - $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId - if ($preTelemetryId -eq '') { - [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.private\Get-AzDeviceRegistryCredentials_Get'; - GetViaIdentity = 'Az.DeviceRegistry.private\Get-AzDeviceRegistryCredentials_GetViaIdentity'; - List = 'Az.DeviceRegistry.private\Get-AzDeviceRegistryCredentials_List'; - } - if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { - 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.DeviceRegistry.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.DeviceRegistry.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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) - if ($wrappedCmd -eq $null) { - $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) - } - $scriptCmd = {& $wrappedCmd @PSBoundParameters} - $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) - $steppablePipeline.Begin($PSCmdlet) - } 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.DeviceRegistry.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/DeviceRegistry/DeviceRegistry.Autorest/exports/Get-AzDeviceRegistryNamespace.ps1 b/generated/DeviceRegistry/DeviceRegistry.Autorest/exports/Get-AzDeviceRegistryNamespace.ps1 index aaa828a386f0..a5526eca8c5f 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/exports/Get-AzDeviceRegistryNamespace.ps1 +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/exports/Get-AzDeviceRegistryNamespace.ps1 @@ -53,7 +53,6 @@ INPUTOBJECT : Identity Parameter [Location ]: The name of the Azure region. [NamespaceName ]: The name of the namespace. [OperationId ]: The ID of an ongoing async operation. - [PolicyName ]: The name of the Policy tracked resource. [ResourceGroupName ]: The name of the resource group. The name is case insensitive. [SchemaName ]: Schema name parameter. [SchemaRegistryName ]: Schema registry name parameter. diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/exports/Get-AzDeviceRegistryNamespaceAsset.ps1 b/generated/DeviceRegistry/DeviceRegistry.Autorest/exports/Get-AzDeviceRegistryNamespaceAsset.ps1 index b6d4afb73093..8ad5473611e3 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/exports/Get-AzDeviceRegistryNamespaceAsset.ps1 +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/exports/Get-AzDeviceRegistryNamespaceAsset.ps1 @@ -59,7 +59,6 @@ INPUTOBJECT : Identity Parameter [Location ]: The name of the Azure region. [NamespaceName ]: The name of the namespace. [OperationId ]: The ID of an ongoing async operation. - [PolicyName ]: The name of the Policy tracked resource. [ResourceGroupName ]: The name of the resource group. The name is case insensitive. [SchemaName ]: Schema name parameter. [SchemaRegistryName ]: Schema registry name parameter. @@ -77,7 +76,6 @@ NAMESPACEINPUTOBJECT : Identity Parameter [Location ]: The name of the Azure region. [NamespaceName ]: The name of the namespace. [OperationId ]: The ID of an ongoing async operation. - [PolicyName ]: The name of the Policy tracked resource. [ResourceGroupName ]: The name of the resource group. The name is case insensitive. [SchemaName ]: Schema name parameter. [SchemaRegistryName ]: Schema registry name parameter. diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/exports/Get-AzDeviceRegistryNamespaceDevice.ps1 b/generated/DeviceRegistry/DeviceRegistry.Autorest/exports/Get-AzDeviceRegistryNamespaceDevice.ps1 index f618009bd549..d1ddea093dc5 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/exports/Get-AzDeviceRegistryNamespaceDevice.ps1 +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/exports/Get-AzDeviceRegistryNamespaceDevice.ps1 @@ -59,7 +59,6 @@ INPUTOBJECT : Identity Parameter [Location ]: The name of the Azure region. [NamespaceName ]: The name of the namespace. [OperationId ]: The ID of an ongoing async operation. - [PolicyName ]: The name of the Policy tracked resource. [ResourceGroupName ]: The name of the resource group. The name is case insensitive. [SchemaName ]: Schema name parameter. [SchemaRegistryName ]: Schema registry name parameter. @@ -77,7 +76,6 @@ NAMESPACEINPUTOBJECT : Identity Parameter [Location ]: The name of the Azure region. [NamespaceName ]: The name of the namespace. [OperationId ]: The ID of an ongoing async operation. - [PolicyName ]: The name of the Policy tracked resource. [ResourceGroupName ]: The name of the resource group. The name is case insensitive. [SchemaName ]: Schema name parameter. [SchemaRegistryName ]: Schema registry name parameter. diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/exports/Get-AzDeviceRegistryNamespaceDiscoveredAsset.ps1 b/generated/DeviceRegistry/DeviceRegistry.Autorest/exports/Get-AzDeviceRegistryNamespaceDiscoveredAsset.ps1 index 99130565a058..38b576539c8b 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/exports/Get-AzDeviceRegistryNamespaceDiscoveredAsset.ps1 +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/exports/Get-AzDeviceRegistryNamespaceDiscoveredAsset.ps1 @@ -59,7 +59,6 @@ INPUTOBJECT : Identity Parameter [Location ]: The name of the Azure region. [NamespaceName ]: The name of the namespace. [OperationId ]: The ID of an ongoing async operation. - [PolicyName ]: The name of the Policy tracked resource. [ResourceGroupName ]: The name of the resource group. The name is case insensitive. [SchemaName ]: Schema name parameter. [SchemaRegistryName ]: Schema registry name parameter. @@ -77,7 +76,6 @@ NAMESPACEINPUTOBJECT : Identity Parameter [Location ]: The name of the Azure region. [NamespaceName ]: The name of the namespace. [OperationId ]: The ID of an ongoing async operation. - [PolicyName ]: The name of the Policy tracked resource. [ResourceGroupName ]: The name of the resource group. The name is case insensitive. [SchemaName ]: Schema name parameter. [SchemaRegistryName ]: Schema registry name parameter. diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/exports/Get-AzDeviceRegistryNamespaceDiscoveredDevice.ps1 b/generated/DeviceRegistry/DeviceRegistry.Autorest/exports/Get-AzDeviceRegistryNamespaceDiscoveredDevice.ps1 index d9c1d7eab189..fd55e192f8ff 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/exports/Get-AzDeviceRegistryNamespaceDiscoveredDevice.ps1 +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/exports/Get-AzDeviceRegistryNamespaceDiscoveredDevice.ps1 @@ -59,7 +59,6 @@ INPUTOBJECT : Identity Parameter [Location ]: The name of the Azure region. [NamespaceName ]: The name of the namespace. [OperationId ]: The ID of an ongoing async operation. - [PolicyName ]: The name of the Policy tracked resource. [ResourceGroupName ]: The name of the resource group. The name is case insensitive. [SchemaName ]: Schema name parameter. [SchemaRegistryName ]: Schema registry name parameter. @@ -77,7 +76,6 @@ NAMESPACEINPUTOBJECT : Identity Parameter [Location ]: The name of the Azure region. [NamespaceName ]: The name of the namespace. [OperationId ]: The ID of an ongoing async operation. - [PolicyName ]: The name of the Policy tracked resource. [ResourceGroupName ]: The name of the resource group. The name is case insensitive. [SchemaName ]: Schema name parameter. [SchemaRegistryName ]: Schema registry name parameter. diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/exports/Get-AzDeviceRegistryPolicy.ps1 b/generated/DeviceRegistry/DeviceRegistry.Autorest/exports/Get-AzDeviceRegistryPolicy.ps1 deleted file mode 100644 index 61a61509af70..000000000000 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/exports/Get-AzDeviceRegistryPolicy.ps1 +++ /dev/null @@ -1,269 +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 -Get a Policy -.Description -Get a Policy -.Example -Get-AzDeviceRegistryPolicy -NamespaceName my-namespace -ResourceGroupName my-resource-group -.Example -Get-AzDeviceRegistryPolicy -Name my-policy-1 -NamespaceName my-namespace -ResourceGroupName my-resource-group - -.Inputs -Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IDeviceRegistryIdentity -.Outputs -Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicy -.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 - [AssetEndpointProfileName ]: Asset Endpoint Profile name parameter. - [AssetName ]: Asset name parameter. - [BillingContainerName ]: Name of the billing container. - [DeviceName ]: The name of the device. - [DiscoveredAssetName ]: The name of the discovered asset. - [DiscoveredDeviceName ]: The name of the discovered device. - [Id ]: Resource identity path - [Location ]: The name of the Azure region. - [NamespaceName ]: The name of the namespace. - [OperationId ]: The ID of an ongoing async operation. - [PolicyName ]: The name of the Policy tracked resource. - [ResourceGroupName ]: The name of the resource group. The name is case insensitive. - [SchemaName ]: Schema name parameter. - [SchemaRegistryName ]: Schema registry name parameter. - [SchemaVersionName ]: Schema version name parameter. - [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. - -NAMESPACEINPUTOBJECT : Identity Parameter - [AssetEndpointProfileName ]: Asset Endpoint Profile name parameter. - [AssetName ]: Asset name parameter. - [BillingContainerName ]: Name of the billing container. - [DeviceName ]: The name of the device. - [DiscoveredAssetName ]: The name of the discovered asset. - [DiscoveredDeviceName ]: The name of the discovered device. - [Id ]: Resource identity path - [Location ]: The name of the Azure region. - [NamespaceName ]: The name of the namespace. - [OperationId ]: The ID of an ongoing async operation. - [PolicyName ]: The name of the Policy tracked resource. - [ResourceGroupName ]: The name of the resource group. The name is case insensitive. - [SchemaName ]: Schema name parameter. - [SchemaRegistryName ]: Schema registry name parameter. - [SchemaVersionName ]: Schema version name parameter. - [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. -.Link -https://learn.microsoft.com/powershell/module/az.deviceregistry/get-azdeviceregistrypolicy -#> -function Get-AzDeviceRegistryPolicy { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicy])] -[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] -param( - [Parameter(ParameterSetName='Get', Mandatory)] - [Parameter(ParameterSetName='GetViaIdentityNamespace', Mandatory)] - [Alias('PolicyName')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Path')] - [System.String] - # The name of the Policy tracked resource. - ${Name}, - - [Parameter(ParameterSetName='Get', Mandatory)] - [Parameter(ParameterSetName='List', Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Path')] - [System.String] - # The name of the namespace. - ${NamespaceName}, - - [Parameter(ParameterSetName='Get', Mandatory)] - [Parameter(ParameterSetName='List', Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Path')] - [System.String] - # The name of the resource group. - # The name is case insensitive. - ${ResourceGroupName}, - - [Parameter(ParameterSetName='Get')] - [Parameter(ParameterSetName='List')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Path')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] - [System.String[]] - # The ID of the target subscription. - # The value must be an UUID. - ${SubscriptionId}, - - [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Path')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IDeviceRegistryIdentity] - # Identity Parameter - ${InputObject}, - - [Parameter(ParameterSetName='GetViaIdentityNamespace', Mandatory, ValueFromPipeline)] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Path')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IDeviceRegistryIdentity] - # Identity Parameter - ${NamespaceInputObject}, - - [Parameter()] - [Alias('AzureRMContext', 'AzureCredential')] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category('Runtime')] - [System.Management.Automation.SwitchParameter] - # Wait for .NET debugger to attach - ${Break}, - - [Parameter(DontShow)] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Runtime')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SendAsyncStep[]] - # SendAsync Pipeline Steps to be appended to the front of the pipeline - ${HttpPipelineAppend}, - - [Parameter(DontShow)] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Runtime')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SendAsyncStep[]] - # SendAsync Pipeline Steps to be prepended to the front of the pipeline - ${HttpPipelinePrepend}, - - [Parameter(DontShow)] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Runtime')] - [System.Uri] - # The URI for the proxy server to use - ${Proxy}, - - [Parameter(DontShow)] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Runtime')] - [System.Management.Automation.PSCredential] - # Credentials for a proxy server to use for the remote call - ${ProxyCredential}, - - [Parameter(DontShow)] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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 - - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } - - $context = Get-AzContext - if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit - } - - if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() - } - $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId - if ($preTelemetryId -eq '') { - [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.private\Get-AzDeviceRegistryPolicy_Get'; - GetViaIdentity = 'Az.DeviceRegistry.private\Get-AzDeviceRegistryPolicy_GetViaIdentity'; - GetViaIdentityNamespace = 'Az.DeviceRegistry.private\Get-AzDeviceRegistryPolicy_GetViaIdentityNamespace'; - List = 'Az.DeviceRegistry.private\Get-AzDeviceRegistryPolicy_List'; - } - if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { - 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.DeviceRegistry.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.DeviceRegistry.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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) - if ($wrappedCmd -eq $null) { - $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) - } - $scriptCmd = {& $wrappedCmd @PSBoundParameters} - $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) - $steppablePipeline.Begin($PSCmdlet) - } 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.DeviceRegistry.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/DeviceRegistry/DeviceRegistry.Autorest/exports/Get-AzDeviceRegistrySchema.ps1 b/generated/DeviceRegistry/DeviceRegistry.Autorest/exports/Get-AzDeviceRegistrySchema.ps1 index 95b35a8c20e5..9d71c221272c 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/exports/Get-AzDeviceRegistrySchema.ps1 +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/exports/Get-AzDeviceRegistrySchema.ps1 @@ -59,7 +59,6 @@ INPUTOBJECT : Identity Parameter [Location ]: The name of the Azure region. [NamespaceName ]: The name of the namespace. [OperationId ]: The ID of an ongoing async operation. - [PolicyName ]: The name of the Policy tracked resource. [ResourceGroupName ]: The name of the resource group. The name is case insensitive. [SchemaName ]: Schema name parameter. [SchemaRegistryName ]: Schema registry name parameter. @@ -77,7 +76,6 @@ SCHEMAREGISTRYINPUTOBJECT : Identity Parameter [Location ]: The name of the Azure region. [NamespaceName ]: The name of the namespace. [OperationId ]: The ID of an ongoing async operation. - [PolicyName ]: The name of the Policy tracked resource. [ResourceGroupName ]: The name of the resource group. The name is case insensitive. [SchemaName ]: Schema name parameter. [SchemaRegistryName ]: Schema registry name parameter. diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/exports/Get-AzDeviceRegistrySchemaRegistry.ps1 b/generated/DeviceRegistry/DeviceRegistry.Autorest/exports/Get-AzDeviceRegistrySchemaRegistry.ps1 index a5f25ae31cc8..ee6b2b08a594 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/exports/Get-AzDeviceRegistrySchemaRegistry.ps1 +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/exports/Get-AzDeviceRegistrySchemaRegistry.ps1 @@ -51,7 +51,6 @@ INPUTOBJECT : Identity Parameter [Location ]: The name of the Azure region. [NamespaceName ]: The name of the namespace. [OperationId ]: The ID of an ongoing async operation. - [PolicyName ]: The name of the Policy tracked resource. [ResourceGroupName ]: The name of the resource group. The name is case insensitive. [SchemaName ]: Schema name parameter. [SchemaRegistryName ]: Schema registry name parameter. diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/exports/Get-AzDeviceRegistrySchemaVersion.ps1 b/generated/DeviceRegistry/DeviceRegistry.Autorest/exports/Get-AzDeviceRegistrySchemaVersion.ps1 index c492c3a63bd4..e68f60715a6b 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/exports/Get-AzDeviceRegistrySchemaVersion.ps1 +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/exports/Get-AzDeviceRegistrySchemaVersion.ps1 @@ -59,7 +59,6 @@ INPUTOBJECT : Identity Parameter [Location ]: The name of the Azure region. [NamespaceName ]: The name of the namespace. [OperationId ]: The ID of an ongoing async operation. - [PolicyName ]: The name of the Policy tracked resource. [ResourceGroupName ]: The name of the resource group. The name is case insensitive. [SchemaName ]: Schema name parameter. [SchemaRegistryName ]: Schema registry name parameter. @@ -77,7 +76,6 @@ SCHEMAINPUTOBJECT : Identity Parameter [Location ]: The name of the Azure region. [NamespaceName ]: The name of the namespace. [OperationId ]: The ID of an ongoing async operation. - [PolicyName ]: The name of the Policy tracked resource. [ResourceGroupName ]: The name of the resource group. The name is case insensitive. [SchemaName ]: Schema name parameter. [SchemaRegistryName ]: Schema registry name parameter. @@ -95,7 +93,6 @@ SCHEMAREGISTRYINPUTOBJECT : Identity Parameter [Location ]: The name of the Azure region. [NamespaceName ]: The name of the namespace. [OperationId ]: The ID of an ongoing async operation. - [PolicyName ]: The name of the Policy tracked resource. [ResourceGroupName ]: The name of the resource group. The name is case insensitive. [SchemaName ]: Schema name parameter. [SchemaRegistryName ]: Schema registry name parameter. diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/exports/Move-AzDeviceRegistryNamespace.ps1 b/generated/DeviceRegistry/DeviceRegistry.Autorest/exports/Move-AzDeviceRegistryNamespace.ps1 index e876cb44a680..68c21f02de4e 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/exports/Move-AzDeviceRegistryNamespace.ps1 +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/exports/Move-AzDeviceRegistryNamespace.ps1 @@ -66,7 +66,6 @@ INPUTOBJECT : Identity Parameter [Location ]: The name of the Azure region. [NamespaceName ]: The name of the namespace. [OperationId ]: The ID of an ongoing async operation. - [PolicyName ]: The name of the Policy tracked resource. [ResourceGroupName ]: The name of the resource group. The name is case insensitive. [SchemaName ]: Schema name parameter. [SchemaRegistryName ]: Schema registry name parameter. diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/exports/New-AzDeviceRegistryCredentials.ps1 b/generated/DeviceRegistry/DeviceRegistry.Autorest/exports/New-AzDeviceRegistryCredentials.ps1 deleted file mode 100644 index d8c7be2a53c9..000000000000 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/exports/New-AzDeviceRegistryCredentials.ps1 +++ /dev/null @@ -1,252 +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 -Create a Credential -.Description -Create a Credential -.Example -New-AzDeviceRegistryCredentials -NamespaceName my-namespace -ResourceGroupName my-resource-group -Location eastus2 -Tag @{"environment" = "production"; "team" = "iot"} -.Example -New-AzDeviceRegistryCredentials -NamespaceName my-namespace -ResourceGroupName my-resource-group -JsonFilePath "C:\credentials\config.json" -.Example -$jsonString = @" -{ - "location": "eastus2", - "tags": { - "environment": "production", - "team": "iot" - } -} -"@ - -New-AzDeviceRegistryCredentials -NamespaceName my-namespace -ResourceGroupName my-resource-group -JsonString $jsonString - -.Outputs -Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICredential -.Link -https://learn.microsoft.com/powershell/module/az.deviceregistry/new-azdeviceregistrycredentials -#> -function New-AzDeviceRegistryCredentials { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICredential])] -[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] -param( - [Parameter(Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Path')] - [System.String] - # The name of the namespace. - ${NamespaceName}, - - [Parameter(Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Path')] - [System.String] - # The name of the resource group. - # The name is case insensitive. - ${ResourceGroupName}, - - [Parameter()] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Path')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] - [System.String] - # The ID of the target subscription. - # The value must be an UUID. - ${SubscriptionId}, - - [Parameter(ParameterSetName='CreateExpanded', Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] - [System.String] - # The geo-location where the resource lives - ${Location}, - - [Parameter(ParameterSetName='CreateExpanded')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ITrackedResourceTags]))] - [System.Collections.Hashtable] - # Resource tags. - ${Tag}, - - [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] - [System.String] - # Path of Json file supplied to the Create operation - ${JsonFilePath}, - - [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] - [System.String] - # Json string supplied to the Create operation - ${JsonString}, - - [Parameter()] - [Alias('AzureRMContext', 'AzureCredential')] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category('Runtime')] - [System.Management.Automation.SwitchParameter] - # Run the command as a job - ${AsJob}, - - [Parameter(DontShow)] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Runtime')] - [System.Management.Automation.SwitchParameter] - # Wait for .NET debugger to attach - ${Break}, - - [Parameter(DontShow)] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Runtime')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SendAsyncStep[]] - # SendAsync Pipeline Steps to be appended to the front of the pipeline - ${HttpPipelineAppend}, - - [Parameter(DontShow)] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Runtime')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SendAsyncStep[]] - # SendAsync Pipeline Steps to be prepended to the front of the pipeline - ${HttpPipelinePrepend}, - - [Parameter()] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Runtime')] - [System.Management.Automation.SwitchParameter] - # Run the command asynchronously - ${NoWait}, - - [Parameter(DontShow)] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Runtime')] - [System.Uri] - # The URI for the proxy server to use - ${Proxy}, - - [Parameter(DontShow)] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Runtime')] - [System.Management.Automation.PSCredential] - # Credentials for a proxy server to use for the remote call - ${ProxyCredential}, - - [Parameter(DontShow)] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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 - - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } - - $context = Get-AzContext - if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit - } - - if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() - } - $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId - if ($preTelemetryId -eq '') { - [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) - } else { - $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets - if ($internalCalledCmdlets -eq '') { - [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name - } else { - [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name - } - [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' - } - - $mapping = @{ - CreateExpanded = 'Az.DeviceRegistry.private\New-AzDeviceRegistryCredentials_CreateExpanded'; - CreateViaJsonFilePath = 'Az.DeviceRegistry.private\New-AzDeviceRegistryCredentials_CreateViaJsonFilePath'; - CreateViaJsonString = 'Az.DeviceRegistry.private\New-AzDeviceRegistryCredentials_CreateViaJsonString'; - } - if (('CreateExpanded', 'CreateViaJsonFilePath', 'CreateViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { - 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.DeviceRegistry.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.DeviceRegistry.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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) - if ($wrappedCmd -eq $null) { - $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) - } - $scriptCmd = {& $wrappedCmd @PSBoundParameters} - $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) - $steppablePipeline.Begin($PSCmdlet) - } 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.DeviceRegistry.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/DeviceRegistry/DeviceRegistry.Autorest/exports/New-AzDeviceRegistryNamespaceDevice.ps1 b/generated/DeviceRegistry/DeviceRegistry.Autorest/exports/New-AzDeviceRegistryNamespaceDevice.ps1 index 284d2edfbd40..98baca15159e 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/exports/New-AzDeviceRegistryNamespaceDevice.ps1 +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/exports/New-AzDeviceRegistryNamespaceDevice.ps1 @@ -175,12 +175,6 @@ param( # Set of most recently removed endpoints. ${OutboundUnassigned}, - [Parameter(ParameterSetName='CreateExpanded')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] - [System.String] - # Resource Id of the Policy. - ${PolicyResourceId}, - [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ITrackedResourceTags]))] diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/exports/New-AzDeviceRegistryPolicy.ps1 b/generated/DeviceRegistry/DeviceRegistry.Autorest/exports/New-AzDeviceRegistryPolicy.ps1 deleted file mode 100644 index 99a493e67439..000000000000 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/exports/New-AzDeviceRegistryPolicy.ps1 +++ /dev/null @@ -1,295 +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 -Create a Policy -.Description -Create a Policy -.Example -$jsonString = @" -{ - "location": "eastus2", - "properties": { - "certificate": { - "certificateAuthorityConfiguration": { - "keyType": "ECC" - }, - "leafCertificateConfiguration": { - "validityPeriodInDays": 90 - } - } - }, - "tags": { - "environment": "production", - "team": "iot" - } -} -"@ - -New-AzDeviceRegistryPolicy -Name my-policy-ecc -NamespaceName my-namespace -ResourceGroupName my-resource-group -JsonString $jsonString -.Example -$jsonString = @" -{ - "location": "eastus2", - "properties": { - "certificate": { - "certificateAuthorityConfiguration": { - "keyType": "RSA" - }, - "leafCertificateConfiguration": { - "validityPeriodInDays": 365 - } - } - }, - "tags": { - "environment": "production", - "certType": "RSA" - } -} -"@ - -New-AzDeviceRegistryPolicy -Name my-policy-rsa -NamespaceName my-namespace -ResourceGroupName my-resource-group -JsonString $jsonString -.Example -New-AzDeviceRegistryPolicy -Name my-policy -NamespaceName my-namespace -ResourceGroupName my-resource-group -JsonFilePath "C:\policies\policy-config.json" - -.Outputs -Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicy -.Link -https://learn.microsoft.com/powershell/module/az.deviceregistry/new-azdeviceregistrypolicy -#> -function New-AzDeviceRegistryPolicy { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicy])] -[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] -param( - [Parameter(Mandatory)] - [Alias('PolicyName')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Path')] - [System.String] - # The name of the Policy tracked resource. - ${Name}, - - [Parameter(Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Path')] - [System.String] - # The name of the namespace. - ${NamespaceName}, - - [Parameter(Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Path')] - [System.String] - # The name of the resource group. - # The name is case insensitive. - ${ResourceGroupName}, - - [Parameter()] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Path')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] - [System.String] - # The ID of the target subscription. - # The value must be an UUID. - ${SubscriptionId}, - - [Parameter(ParameterSetName='CreateExpanded', Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] - [System.String] - # The geo-location where the resource lives - ${Location}, - - [Parameter(ParameterSetName='CreateExpanded')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] - [System.Int32] - # The validity period in days. - ${LeafCertificateConfigurationValidityPeriodInDay}, - - [Parameter(ParameterSetName='CreateExpanded')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ITrackedResourceTags]))] - [System.Collections.Hashtable] - # Resource tags. - ${Tag}, - - [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] - [System.String] - # Path of Json file supplied to the Create operation - ${JsonFilePath}, - - [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] - [System.String] - # Json string supplied to the Create operation - ${JsonString}, - - [Parameter()] - [Alias('AzureRMContext', 'AzureCredential')] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category('Runtime')] - [System.Management.Automation.SwitchParameter] - # Run the command as a job - ${AsJob}, - - [Parameter(DontShow)] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Runtime')] - [System.Management.Automation.SwitchParameter] - # Wait for .NET debugger to attach - ${Break}, - - [Parameter(DontShow)] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Runtime')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SendAsyncStep[]] - # SendAsync Pipeline Steps to be appended to the front of the pipeline - ${HttpPipelineAppend}, - - [Parameter(DontShow)] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Runtime')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SendAsyncStep[]] - # SendAsync Pipeline Steps to be prepended to the front of the pipeline - ${HttpPipelinePrepend}, - - [Parameter()] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Runtime')] - [System.Management.Automation.SwitchParameter] - # Run the command asynchronously - ${NoWait}, - - [Parameter(DontShow)] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Runtime')] - [System.Uri] - # The URI for the proxy server to use - ${Proxy}, - - [Parameter(DontShow)] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Runtime')] - [System.Management.Automation.PSCredential] - # Credentials for a proxy server to use for the remote call - ${ProxyCredential}, - - [Parameter(DontShow)] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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 - - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } - - $context = Get-AzContext - if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit - } - - if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() - } - $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId - if ($preTelemetryId -eq '') { - [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) - } else { - $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets - if ($internalCalledCmdlets -eq '') { - [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name - } else { - [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name - } - [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' - } - - $mapping = @{ - CreateExpanded = 'Az.DeviceRegistry.private\New-AzDeviceRegistryPolicy_CreateExpanded'; - CreateViaJsonFilePath = 'Az.DeviceRegistry.private\New-AzDeviceRegistryPolicy_CreateViaJsonFilePath'; - CreateViaJsonString = 'Az.DeviceRegistry.private\New-AzDeviceRegistryPolicy_CreateViaJsonString'; - } - if (('CreateExpanded', 'CreateViaJsonFilePath', 'CreateViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { - 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.DeviceRegistry.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.DeviceRegistry.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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) - if ($wrappedCmd -eq $null) { - $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) - } - $scriptCmd = {& $wrappedCmd @PSBoundParameters} - $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) - $steppablePipeline.Begin($PSCmdlet) - } 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.DeviceRegistry.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/DeviceRegistry/DeviceRegistry.Autorest/exports/ProxyCmdletDefinitions.ps1 b/generated/DeviceRegistry/DeviceRegistry.Autorest/exports/ProxyCmdletDefinitions.ps1 index 78ad191bb33c..03b8d0d8a6d3 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/exports/ProxyCmdletDefinitions.ps1 +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/exports/ProxyCmdletDefinitions.ps1 @@ -49,7 +49,6 @@ INPUTOBJECT : Identity Parameter [Location ]: The name of the Azure region. [NamespaceName ]: The name of the namespace. [OperationId ]: The ID of an ongoing async operation. - [PolicyName ]: The name of the Policy tracked resource. [ResourceGroupName ]: The name of the resource group. The name is case insensitive. [SchemaName ]: Schema name parameter. [SchemaRegistryName ]: Schema registry name parameter. @@ -277,7 +276,6 @@ INPUTOBJECT : Identity Parameter [Location ]: The name of the Azure region. [NamespaceName ]: The name of the namespace. [OperationId ]: The ID of an ongoing async operation. - [PolicyName ]: The name of the Policy tracked resource. [ResourceGroupName ]: The name of the resource group. The name is case insensitive. [SchemaName ]: Schema name parameter. [SchemaRegistryName ]: Schema registry name parameter. @@ -506,7 +504,6 @@ INPUTOBJECT : Identity Parameter [Location ]: The name of the Azure region. [NamespaceName ]: The name of the namespace. [OperationId ]: The ID of an ongoing async operation. - [PolicyName ]: The name of the Policy tracked resource. [ResourceGroupName ]: The name of the resource group. The name is case insensitive. [SchemaName ]: Schema name parameter. [SchemaRegistryName ]: Schema registry name parameter. @@ -689,227 +686,6 @@ end { } } -<# -.Synopsis -Get a Credential -.Description -Get a Credential -.Example -Get-AzDeviceRegistryCredentials -NamespaceName my-namespace -ResourceGroupName my-resource-group -.Example -Get-AzDeviceRegistryNamespace -Name my-namespace -ResourceGroupName my-resource-group | Get-AzDeviceRegistryCredentials - -.Inputs -Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IDeviceRegistryIdentity -.Outputs -Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICredential -.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 - [AssetEndpointProfileName ]: Asset Endpoint Profile name parameter. - [AssetName ]: Asset name parameter. - [BillingContainerName ]: Name of the billing container. - [DeviceName ]: The name of the device. - [DiscoveredAssetName ]: The name of the discovered asset. - [DiscoveredDeviceName ]: The name of the discovered device. - [Id ]: Resource identity path - [Location ]: The name of the Azure region. - [NamespaceName ]: The name of the namespace. - [OperationId ]: The ID of an ongoing async operation. - [PolicyName ]: The name of the Policy tracked resource. - [ResourceGroupName ]: The name of the resource group. The name is case insensitive. - [SchemaName ]: Schema name parameter. - [SchemaRegistryName ]: Schema registry name parameter. - [SchemaVersionName ]: Schema version name parameter. - [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. -.Link -https://learn.microsoft.com/powershell/module/az.deviceregistry/get-azdeviceregistrycredentials -#> -function Get-AzDeviceRegistryCredentials { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICredential])] -[CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false)] -param( - [Parameter(ParameterSetName='Get', Mandatory)] - [Parameter(ParameterSetName='List', Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Path')] - [System.String] - # The name of the namespace. - ${NamespaceName}, - - [Parameter(ParameterSetName='Get', Mandatory)] - [Parameter(ParameterSetName='List', Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Path')] - [System.String] - # The name of the resource group. - # The name is case insensitive. - ${ResourceGroupName}, - - [Parameter(ParameterSetName='Get')] - [Parameter(ParameterSetName='List')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Path')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] - [System.String[]] - # The ID of the target subscription. - # The value must be an UUID. - ${SubscriptionId}, - - [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Path')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IDeviceRegistryIdentity] - # Identity Parameter - ${InputObject}, - - [Parameter()] - [Alias('AzureRMContext', 'AzureCredential')] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category('Runtime')] - [System.Management.Automation.SwitchParameter] - # Wait for .NET debugger to attach - ${Break}, - - [Parameter(DontShow)] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Runtime')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SendAsyncStep[]] - # SendAsync Pipeline Steps to be appended to the front of the pipeline - ${HttpPipelineAppend}, - - [Parameter(DontShow)] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Runtime')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SendAsyncStep[]] - # SendAsync Pipeline Steps to be prepended to the front of the pipeline - ${HttpPipelinePrepend}, - - [Parameter(DontShow)] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Runtime')] - [System.Uri] - # The URI for the proxy server to use - ${Proxy}, - - [Parameter(DontShow)] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Runtime')] - [System.Management.Automation.PSCredential] - # Credentials for a proxy server to use for the remote call - ${ProxyCredential}, - - [Parameter(DontShow)] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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 - - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } - - $context = Get-AzContext - if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit - } - - if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() - } - $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId - if ($preTelemetryId -eq '') { - [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.private\Get-AzDeviceRegistryCredentials_Get'; - GetViaIdentity = 'Az.DeviceRegistry.private\Get-AzDeviceRegistryCredentials_GetViaIdentity'; - List = 'Az.DeviceRegistry.private\Get-AzDeviceRegistryCredentials_List'; - } - if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { - 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.DeviceRegistry.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.DeviceRegistry.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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) - if ($wrappedCmd -eq $null) { - $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) - } - $scriptCmd = {& $wrappedCmd @PSBoundParameters} - $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) - $steppablePipeline.Begin($PSCmdlet) - } 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.DeviceRegistry.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) - [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() - } - [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId - - } catch { - [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() - throw - } -} -} - <# .Synopsis Get a NamespaceAsset @@ -955,7 +731,6 @@ INPUTOBJECT : Identity Parameter [Location ]: The name of the Azure region. [NamespaceName ]: The name of the namespace. [OperationId ]: The ID of an ongoing async operation. - [PolicyName ]: The name of the Policy tracked resource. [ResourceGroupName ]: The name of the resource group. The name is case insensitive. [SchemaName ]: Schema name parameter. [SchemaRegistryName ]: Schema registry name parameter. @@ -973,7 +748,6 @@ NAMESPACEINPUTOBJECT : Identity Parameter [Location ]: The name of the Azure region. [NamespaceName ]: The name of the namespace. [OperationId ]: The ID of an ongoing async operation. - [PolicyName ]: The name of the Policy tracked resource. [ResourceGroupName ]: The name of the resource group. The name is case insensitive. [SchemaName ]: Schema name parameter. [SchemaRegistryName ]: Schema registry name parameter. @@ -1223,7 +997,6 @@ INPUTOBJECT : Identity Parameter [Location ]: The name of the Azure region. [NamespaceName ]: The name of the namespace. [OperationId ]: The ID of an ongoing async operation. - [PolicyName ]: The name of the Policy tracked resource. [ResourceGroupName ]: The name of the resource group. The name is case insensitive. [SchemaName ]: Schema name parameter. [SchemaRegistryName ]: Schema registry name parameter. @@ -1241,7 +1014,6 @@ NAMESPACEINPUTOBJECT : Identity Parameter [Location ]: The name of the Azure region. [NamespaceName ]: The name of the namespace. [OperationId ]: The ID of an ongoing async operation. - [PolicyName ]: The name of the Policy tracked resource. [ResourceGroupName ]: The name of the resource group. The name is case insensitive. [SchemaName ]: Schema name parameter. [SchemaRegistryName ]: Schema registry name parameter. @@ -1491,7 +1263,6 @@ INPUTOBJECT : Identity Parameter [Location ]: The name of the Azure region. [NamespaceName ]: The name of the namespace. [OperationId ]: The ID of an ongoing async operation. - [PolicyName ]: The name of the Policy tracked resource. [ResourceGroupName ]: The name of the resource group. The name is case insensitive. [SchemaName ]: Schema name parameter. [SchemaRegistryName ]: Schema registry name parameter. @@ -1509,7 +1280,6 @@ NAMESPACEINPUTOBJECT : Identity Parameter [Location ]: The name of the Azure region. [NamespaceName ]: The name of the namespace. [OperationId ]: The ID of an ongoing async operation. - [PolicyName ]: The name of the Policy tracked resource. [ResourceGroupName ]: The name of the resource group. The name is case insensitive. [SchemaName ]: Schema name parameter. [SchemaRegistryName ]: Schema registry name parameter. @@ -1759,7 +1529,6 @@ INPUTOBJECT : Identity Parameter [Location ]: The name of the Azure region. [NamespaceName ]: The name of the namespace. [OperationId ]: The ID of an ongoing async operation. - [PolicyName ]: The name of the Policy tracked resource. [ResourceGroupName ]: The name of the resource group. The name is case insensitive. [SchemaName ]: Schema name parameter. [SchemaRegistryName ]: Schema registry name parameter. @@ -1777,7 +1546,6 @@ NAMESPACEINPUTOBJECT : Identity Parameter [Location ]: The name of the Azure region. [NamespaceName ]: The name of the namespace. [OperationId ]: The ID of an ongoing async operation. - [PolicyName ]: The name of the Policy tracked resource. [ResourceGroupName ]: The name of the resource group. The name is case insensitive. [SchemaName ]: Schema name parameter. [SchemaRegistryName ]: Schema registry name parameter. @@ -2021,7 +1789,6 @@ INPUTOBJECT : Identity Parameter [Location ]: The name of the Azure region. [NamespaceName ]: The name of the namespace. [OperationId ]: The ID of an ongoing async operation. - [PolicyName ]: The name of the Policy tracked resource. [ResourceGroupName ]: The name of the resource group. The name is case insensitive. [SchemaName ]: Schema name parameter. [SchemaRegistryName ]: Schema registry name parameter. @@ -2216,18 +1983,25 @@ end { <# .Synopsis -Get a Policy +Get a SchemaRegistry .Description -Get a Policy +Get a SchemaRegistry +.Example +Get-AzDeviceRegistrySchemaRegistry -ResourceGroupName "my-resource-group" .Example -Get-AzDeviceRegistryPolicy -NamespaceName my-namespace -ResourceGroupName my-resource-group +Get-AzDeviceRegistrySchemaRegistry -ResourceGroupName "my-resource-group" -SchemaRegistryName "my-schema-registry" .Example -Get-AzDeviceRegistryPolicy -Name my-policy-1 -NamespaceName my-namespace -ResourceGroupName my-resource-group +$identity = @{ + SubscriptionId = "my-subscription" + ResourceGroupName = "my-resource-group" + SchemaRegistryName = "my-schema-registry" +} +Get-AzDeviceRegistrySchemaRegistry -InputObject $identity .Inputs Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IDeviceRegistryIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicy +Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ISchemaRegistry .Notes COMPLEX PARAMETER PROPERTIES @@ -2244,54 +2018,27 @@ INPUTOBJECT : Identity Parameter [Location ]: The name of the Azure region. [NamespaceName ]: The name of the namespace. [OperationId ]: The ID of an ongoing async operation. - [PolicyName ]: The name of the Policy tracked resource. - [ResourceGroupName ]: The name of the resource group. The name is case insensitive. - [SchemaName ]: Schema name parameter. - [SchemaRegistryName ]: Schema registry name parameter. - [SchemaVersionName ]: Schema version name parameter. - [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. - -NAMESPACEINPUTOBJECT : Identity Parameter - [AssetEndpointProfileName ]: Asset Endpoint Profile name parameter. - [AssetName ]: Asset name parameter. - [BillingContainerName ]: Name of the billing container. - [DeviceName ]: The name of the device. - [DiscoveredAssetName ]: The name of the discovered asset. - [DiscoveredDeviceName ]: The name of the discovered device. - [Id ]: Resource identity path - [Location ]: The name of the Azure region. - [NamespaceName ]: The name of the namespace. - [OperationId ]: The ID of an ongoing async operation. - [PolicyName ]: The name of the Policy tracked resource. [ResourceGroupName ]: The name of the resource group. The name is case insensitive. [SchemaName ]: Schema name parameter. [SchemaRegistryName ]: Schema registry name parameter. [SchemaVersionName ]: Schema version name parameter. [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. .Link -https://learn.microsoft.com/powershell/module/az.deviceregistry/get-azdeviceregistrypolicy +https://learn.microsoft.com/powershell/module/az.deviceregistry/get-azdeviceregistryschemaregistry #> -function Get-AzDeviceRegistryPolicy { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicy])] +function Get-AzDeviceRegistrySchemaRegistry { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ISchemaRegistry])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] - [Parameter(ParameterSetName='GetViaIdentityNamespace', Mandatory)] - [Alias('PolicyName')] + [Alias('SchemaRegistryName')] [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Path')] [System.String] - # The name of the Policy tracked resource. + # Schema registry name parameter. ${Name}, [Parameter(ParameterSetName='Get', Mandatory)] - [Parameter(ParameterSetName='List', Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Path')] - [System.String] - # The name of the namespace. - ${NamespaceName}, - - [Parameter(ParameterSetName='Get', Mandatory)] - [Parameter(ParameterSetName='List', Mandatory)] + [Parameter(ParameterSetName='List1', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Path')] [System.String] # The name of the resource group. @@ -2300,242 +2047,7 @@ param( [Parameter(ParameterSetName='Get')] [Parameter(ParameterSetName='List')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Path')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] - [System.String[]] - # The ID of the target subscription. - # The value must be an UUID. - ${SubscriptionId}, - - [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Path')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IDeviceRegistryIdentity] - # Identity Parameter - ${InputObject}, - - [Parameter(ParameterSetName='GetViaIdentityNamespace', Mandatory, ValueFromPipeline)] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Path')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IDeviceRegistryIdentity] - # Identity Parameter - ${NamespaceInputObject}, - - [Parameter()] - [Alias('AzureRMContext', 'AzureCredential')] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category('Runtime')] - [System.Management.Automation.SwitchParameter] - # Wait for .NET debugger to attach - ${Break}, - - [Parameter(DontShow)] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Runtime')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SendAsyncStep[]] - # SendAsync Pipeline Steps to be appended to the front of the pipeline - ${HttpPipelineAppend}, - - [Parameter(DontShow)] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Runtime')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SendAsyncStep[]] - # SendAsync Pipeline Steps to be prepended to the front of the pipeline - ${HttpPipelinePrepend}, - - [Parameter(DontShow)] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Runtime')] - [System.Uri] - # The URI for the proxy server to use - ${Proxy}, - - [Parameter(DontShow)] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Runtime')] - [System.Management.Automation.PSCredential] - # Credentials for a proxy server to use for the remote call - ${ProxyCredential}, - - [Parameter(DontShow)] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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 - - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } - - $context = Get-AzContext - if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit - } - - if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() - } - $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId - if ($preTelemetryId -eq '') { - [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.private\Get-AzDeviceRegistryPolicy_Get'; - GetViaIdentity = 'Az.DeviceRegistry.private\Get-AzDeviceRegistryPolicy_GetViaIdentity'; - GetViaIdentityNamespace = 'Az.DeviceRegistry.private\Get-AzDeviceRegistryPolicy_GetViaIdentityNamespace'; - List = 'Az.DeviceRegistry.private\Get-AzDeviceRegistryPolicy_List'; - } - if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { - 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.DeviceRegistry.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.DeviceRegistry.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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) - if ($wrappedCmd -eq $null) { - $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) - } - $scriptCmd = {& $wrappedCmd @PSBoundParameters} - $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) - $steppablePipeline.Begin($PSCmdlet) - } 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.DeviceRegistry.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) - [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() - } - [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId - - } catch { - [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() - throw - } -} -} - -<# -.Synopsis -Get a SchemaRegistry -.Description -Get a SchemaRegistry -.Example -Get-AzDeviceRegistrySchemaRegistry -ResourceGroupName "my-resource-group" -.Example -Get-AzDeviceRegistrySchemaRegistry -ResourceGroupName "my-resource-group" -SchemaRegistryName "my-schema-registry" -.Example -$identity = @{ - SubscriptionId = "my-subscription" - ResourceGroupName = "my-resource-group" - SchemaRegistryName = "my-schema-registry" -} -Get-AzDeviceRegistrySchemaRegistry -InputObject $identity - -.Inputs -Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IDeviceRegistryIdentity -.Outputs -Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ISchemaRegistry -.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 - [AssetEndpointProfileName ]: Asset Endpoint Profile name parameter. - [AssetName ]: Asset name parameter. - [BillingContainerName ]: Name of the billing container. - [DeviceName ]: The name of the device. - [DiscoveredAssetName ]: The name of the discovered asset. - [DiscoveredDeviceName ]: The name of the discovered device. - [Id ]: Resource identity path - [Location ]: The name of the Azure region. - [NamespaceName ]: The name of the namespace. - [OperationId ]: The ID of an ongoing async operation. - [PolicyName ]: The name of the Policy tracked resource. - [ResourceGroupName ]: The name of the resource group. The name is case insensitive. - [SchemaName ]: Schema name parameter. - [SchemaRegistryName ]: Schema registry name parameter. - [SchemaVersionName ]: Schema version name parameter. - [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. -.Link -https://learn.microsoft.com/powershell/module/az.deviceregistry/get-azdeviceregistryschemaregistry -#> -function Get-AzDeviceRegistrySchemaRegistry { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ISchemaRegistry])] -[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] -param( - [Parameter(ParameterSetName='Get', Mandatory)] - [Alias('SchemaRegistryName')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Path')] - [System.String] - # Schema registry name parameter. - ${Name}, - - [Parameter(ParameterSetName='Get', Mandatory)] - [Parameter(ParameterSetName='List1', Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Path')] - [System.String] - # The name of the resource group. - # The name is case insensitive. - ${ResourceGroupName}, - - [Parameter(ParameterSetName='Get')] - [Parameter(ParameterSetName='List')] - [Parameter(ParameterSetName='List1')] + [Parameter(ParameterSetName='List1')] [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String[]] @@ -2743,7 +2255,6 @@ INPUTOBJECT : Identity Parameter [Location ]: The name of the Azure region. [NamespaceName ]: The name of the namespace. [OperationId ]: The ID of an ongoing async operation. - [PolicyName ]: The name of the Policy tracked resource. [ResourceGroupName ]: The name of the resource group. The name is case insensitive. [SchemaName ]: Schema name parameter. [SchemaRegistryName ]: Schema registry name parameter. @@ -2761,7 +2272,6 @@ SCHEMAINPUTOBJECT : Identity Parameter [Location ]: The name of the Azure region. [NamespaceName ]: The name of the namespace. [OperationId ]: The ID of an ongoing async operation. - [PolicyName ]: The name of the Policy tracked resource. [ResourceGroupName ]: The name of the resource group. The name is case insensitive. [SchemaName ]: Schema name parameter. [SchemaRegistryName ]: Schema registry name parameter. @@ -2779,7 +2289,6 @@ SCHEMAREGISTRYINPUTOBJECT : Identity Parameter [Location ]: The name of the Azure region. [NamespaceName ]: The name of the namespace. [OperationId ]: The ID of an ongoing async operation. - [PolicyName ]: The name of the Policy tracked resource. [ResourceGroupName ]: The name of the resource group. The name is case insensitive. [SchemaName ]: Schema name parameter. [SchemaRegistryName ]: Schema registry name parameter. @@ -3046,7 +2555,6 @@ INPUTOBJECT : Identity Parameter [Location ]: The name of the Azure region. [NamespaceName ]: The name of the namespace. [OperationId ]: The ID of an ongoing async operation. - [PolicyName ]: The name of the Policy tracked resource. [ResourceGroupName ]: The name of the resource group. The name is case insensitive. [SchemaName ]: Schema name parameter. [SchemaRegistryName ]: Schema registry name parameter. @@ -3064,7 +2572,6 @@ SCHEMAREGISTRYINPUTOBJECT : Identity Parameter [Location ]: The name of the Azure region. [NamespaceName ]: The name of the namespace. [OperationId ]: The ID of an ongoing async operation. - [PolicyName ]: The name of the Policy tracked resource. [ResourceGroupName ]: The name of the resource group. The name is case insensitive. [SchemaName ]: Schema name parameter. [SchemaRegistryName ]: Schema registry name parameter. @@ -3323,7 +2830,6 @@ INPUTOBJECT : Identity Parameter [Location ]: The name of the Azure region. [NamespaceName ]: The name of the namespace. [OperationId ]: The ID of an ongoing async operation. - [PolicyName ]: The name of the Policy tracked resource. [ResourceGroupName ]: The name of the resource group. The name is case insensitive. [SchemaName ]: Schema name parameter. [SchemaRegistryName ]: Schema registry name parameter. @@ -4354,246 +3860,9 @@ end { <# .Synopsis -Create a Credential +Create a NamespaceAsset .Description -Create a Credential -.Example -New-AzDeviceRegistryCredentials -NamespaceName my-namespace -ResourceGroupName my-resource-group -Location eastus2 -Tag @{"environment" = "production"; "team" = "iot"} -.Example -New-AzDeviceRegistryCredentials -NamespaceName my-namespace -ResourceGroupName my-resource-group -JsonFilePath "C:\credentials\config.json" -.Example -$jsonString = @" -{ - "location": "eastus2", - "tags": { - "environment": "production", - "team": "iot" - } -} -"@ - -New-AzDeviceRegistryCredentials -NamespaceName my-namespace -ResourceGroupName my-resource-group -JsonString $jsonString - -.Outputs -Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICredential -.Link -https://learn.microsoft.com/powershell/module/az.deviceregistry/new-azdeviceregistrycredentials -#> -function New-AzDeviceRegistryCredentials { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICredential])] -[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] -param( - [Parameter(Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Path')] - [System.String] - # The name of the namespace. - ${NamespaceName}, - - [Parameter(Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Path')] - [System.String] - # The name of the resource group. - # The name is case insensitive. - ${ResourceGroupName}, - - [Parameter()] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Path')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] - [System.String] - # The ID of the target subscription. - # The value must be an UUID. - ${SubscriptionId}, - - [Parameter(ParameterSetName='CreateExpanded', Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] - [System.String] - # The geo-location where the resource lives - ${Location}, - - [Parameter(ParameterSetName='CreateExpanded')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ITrackedResourceTags]))] - [System.Collections.Hashtable] - # Resource tags. - ${Tag}, - - [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] - [System.String] - # Path of Json file supplied to the Create operation - ${JsonFilePath}, - - [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] - [System.String] - # Json string supplied to the Create operation - ${JsonString}, - - [Parameter()] - [Alias('AzureRMContext', 'AzureCredential')] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category('Runtime')] - [System.Management.Automation.SwitchParameter] - # Run the command as a job - ${AsJob}, - - [Parameter(DontShow)] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Runtime')] - [System.Management.Automation.SwitchParameter] - # Wait for .NET debugger to attach - ${Break}, - - [Parameter(DontShow)] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Runtime')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SendAsyncStep[]] - # SendAsync Pipeline Steps to be appended to the front of the pipeline - ${HttpPipelineAppend}, - - [Parameter(DontShow)] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Runtime')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SendAsyncStep[]] - # SendAsync Pipeline Steps to be prepended to the front of the pipeline - ${HttpPipelinePrepend}, - - [Parameter()] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Runtime')] - [System.Management.Automation.SwitchParameter] - # Run the command asynchronously - ${NoWait}, - - [Parameter(DontShow)] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Runtime')] - [System.Uri] - # The URI for the proxy server to use - ${Proxy}, - - [Parameter(DontShow)] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Runtime')] - [System.Management.Automation.PSCredential] - # Credentials for a proxy server to use for the remote call - ${ProxyCredential}, - - [Parameter(DontShow)] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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 - - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } - - $context = Get-AzContext - if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit - } - - if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() - } - $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId - if ($preTelemetryId -eq '') { - [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) - } else { - $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets - if ($internalCalledCmdlets -eq '') { - [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name - } else { - [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name - } - [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' - } - - $mapping = @{ - CreateExpanded = 'Az.DeviceRegistry.private\New-AzDeviceRegistryCredentials_CreateExpanded'; - CreateViaJsonFilePath = 'Az.DeviceRegistry.private\New-AzDeviceRegistryCredentials_CreateViaJsonFilePath'; - CreateViaJsonString = 'Az.DeviceRegistry.private\New-AzDeviceRegistryCredentials_CreateViaJsonString'; - } - if (('CreateExpanded', 'CreateViaJsonFilePath', 'CreateViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { - 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.DeviceRegistry.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.DeviceRegistry.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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) - if ($wrappedCmd -eq $null) { - $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) - } - $scriptCmd = {& $wrappedCmd @PSBoundParameters} - $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) - $steppablePipeline.Begin($PSCmdlet) - } 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.DeviceRegistry.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 -Create a NamespaceAsset -.Description -Create a NamespaceAsset +Create a NamespaceAsset .Example $eventGroups = @( @{ @@ -5394,12 +4663,6 @@ param( # Set of most recently removed endpoints. ${OutboundUnassigned}, - [Parameter(ParameterSetName='CreateExpanded')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] - [System.String] - # Resource Id of the Policy. - ${PolicyResourceId}, - [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ITrackedResourceTags]))] @@ -6812,78 +6075,43 @@ end { <# .Synopsis -Create a Policy +Create a SchemaRegistry .Description -Create a Policy +Create a SchemaRegistry .Example -$jsonString = @" -{ - "location": "eastus2", - "properties": { - "certificate": { - "certificateAuthorityConfiguration": { - "keyType": "ECC" - }, - "leafCertificateConfiguration": { - "validityPeriodInDays": 90 - } - } - }, - "tags": { - "environment": "production", - "team": "iot" - } -} -"@ - -New-AzDeviceRegistryPolicy -Name my-policy-ecc -NamespaceName my-namespace -ResourceGroupName my-resource-group -JsonString $jsonString +New-AzDeviceRegistrySchemaRegistry -ResourceGroupName "my-resource-group" -SchemaRegistryName "my-schema-registry" -Location "East US" -Namespace "my-namespace" -DisplayName "My Schema Registry" -Description "Registry for device schemas" -StorageAccountContainerUrl "https://mystorageaccount.blob.core.windows.net/schemas" .Example -$jsonString = @" -{ - "location": "eastus2", - "properties": { - "certificate": { - "certificateAuthorityConfiguration": { - "keyType": "RSA" - }, - "leafCertificateConfiguration": { - "validityPeriodInDays": 365 - } - } - }, - "tags": { - "environment": "production", - "certType": "RSA" +New-AzDeviceRegistrySchemaRegistry -ResourceGroupName "my-resource-group" -SchemaRegistryName "my-schema-registry" -JsonFilePath "C:\path\to\schema-registry-config.json" +.Example +$jsonObject = @{ + location = "East US" + properties = @{ + namespace = "my-namespace" + displayName = "My Schema Registry" + description = "Registry for device schemas" + storageAccountContainerUrl = "https://mystorageaccount.blob.core.windows.net/schemas" } } -"@ +$jsonString = $jsonObject | ConvertTo-Json -Depth 10 -New-AzDeviceRegistryPolicy -Name my-policy-rsa -NamespaceName my-namespace -ResourceGroupName my-resource-group -JsonString $jsonString -.Example -New-AzDeviceRegistryPolicy -Name my-policy -NamespaceName my-namespace -ResourceGroupName my-resource-group -JsonFilePath "C:\policies\policy-config.json" +New-AzDeviceRegistrySchemaRegistry -ResourceGroupName "my-resource-group" -SchemaRegistryName "my-schema-registry" -JsonString $jsonString .Outputs -Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicy +Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ISchemaRegistry .Link -https://learn.microsoft.com/powershell/module/az.deviceregistry/new-azdeviceregistrypolicy +https://learn.microsoft.com/powershell/module/az.deviceregistry/new-azdeviceregistryschemaregistry #> -function New-AzDeviceRegistryPolicy { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicy])] +function New-AzDeviceRegistrySchemaRegistry { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ISchemaRegistry])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] - [Alias('PolicyName')] + [Alias('SchemaRegistryName')] [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Path')] [System.String] - # The name of the Policy tracked resource. + # Schema registry name parameter. ${Name}, - [Parameter(Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Path')] - [System.String] - # The name of the namespace. - ${NamespaceName}, - [Parameter(Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Path')] [System.String] @@ -6907,262 +6135,17 @@ param( [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] - [System.Int32] - # The validity period in days. - ${LeafCertificateConfigurationValidityPeriodInDay}, + [System.String] + # Human-readable description of the schema registry. + ${Description}, [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ITrackedResourceTags]))] - [System.Collections.Hashtable] - # Resource tags. - ${Tag}, + [System.String] + # Human-readable display name. + ${DisplayName}, - [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] - [System.String] - # Path of Json file supplied to the Create operation - ${JsonFilePath}, - - [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] - [System.String] - # Json string supplied to the Create operation - ${JsonString}, - - [Parameter()] - [Alias('AzureRMContext', 'AzureCredential')] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category('Runtime')] - [System.Management.Automation.SwitchParameter] - # Run the command as a job - ${AsJob}, - - [Parameter(DontShow)] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Runtime')] - [System.Management.Automation.SwitchParameter] - # Wait for .NET debugger to attach - ${Break}, - - [Parameter(DontShow)] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Runtime')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SendAsyncStep[]] - # SendAsync Pipeline Steps to be appended to the front of the pipeline - ${HttpPipelineAppend}, - - [Parameter(DontShow)] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Runtime')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SendAsyncStep[]] - # SendAsync Pipeline Steps to be prepended to the front of the pipeline - ${HttpPipelinePrepend}, - - [Parameter()] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Runtime')] - [System.Management.Automation.SwitchParameter] - # Run the command asynchronously - ${NoWait}, - - [Parameter(DontShow)] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Runtime')] - [System.Uri] - # The URI for the proxy server to use - ${Proxy}, - - [Parameter(DontShow)] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Runtime')] - [System.Management.Automation.PSCredential] - # Credentials for a proxy server to use for the remote call - ${ProxyCredential}, - - [Parameter(DontShow)] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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 - - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } - - $context = Get-AzContext - if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit - } - - if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() - } - $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId - if ($preTelemetryId -eq '') { - [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) - } else { - $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets - if ($internalCalledCmdlets -eq '') { - [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name - } else { - [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name - } - [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' - } - - $mapping = @{ - CreateExpanded = 'Az.DeviceRegistry.private\New-AzDeviceRegistryPolicy_CreateExpanded'; - CreateViaJsonFilePath = 'Az.DeviceRegistry.private\New-AzDeviceRegistryPolicy_CreateViaJsonFilePath'; - CreateViaJsonString = 'Az.DeviceRegistry.private\New-AzDeviceRegistryPolicy_CreateViaJsonString'; - } - if (('CreateExpanded', 'CreateViaJsonFilePath', 'CreateViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { - 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.DeviceRegistry.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.DeviceRegistry.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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) - if ($wrappedCmd -eq $null) { - $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) - } - $scriptCmd = {& $wrappedCmd @PSBoundParameters} - $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) - $steppablePipeline.Begin($PSCmdlet) - } 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.DeviceRegistry.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 -Create a SchemaRegistry -.Description -Create a SchemaRegistry -.Example -New-AzDeviceRegistrySchemaRegistry -ResourceGroupName "my-resource-group" -SchemaRegistryName "my-schema-registry" -Location "East US" -Namespace "my-namespace" -DisplayName "My Schema Registry" -Description "Registry for device schemas" -StorageAccountContainerUrl "https://mystorageaccount.blob.core.windows.net/schemas" -.Example -New-AzDeviceRegistrySchemaRegistry -ResourceGroupName "my-resource-group" -SchemaRegistryName "my-schema-registry" -JsonFilePath "C:\path\to\schema-registry-config.json" -.Example -$jsonObject = @{ - location = "East US" - properties = @{ - namespace = "my-namespace" - displayName = "My Schema Registry" - description = "Registry for device schemas" - storageAccountContainerUrl = "https://mystorageaccount.blob.core.windows.net/schemas" - } -} -$jsonString = $jsonObject | ConvertTo-Json -Depth 10 - -New-AzDeviceRegistrySchemaRegistry -ResourceGroupName "my-resource-group" -SchemaRegistryName "my-schema-registry" -JsonString $jsonString - -.Outputs -Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ISchemaRegistry -.Link -https://learn.microsoft.com/powershell/module/az.deviceregistry/new-azdeviceregistryschemaregistry -#> -function New-AzDeviceRegistrySchemaRegistry { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ISchemaRegistry])] -[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] -param( - [Parameter(Mandatory)] - [Alias('SchemaRegistryName')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Path')] - [System.String] - # Schema registry name parameter. - ${Name}, - - [Parameter(Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Path')] - [System.String] - # The name of the resource group. - # The name is case insensitive. - ${ResourceGroupName}, - - [Parameter()] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Path')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] - [System.String] - # The ID of the target subscription. - # The value must be an UUID. - ${SubscriptionId}, - - [Parameter(ParameterSetName='CreateExpanded', Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] - [System.String] - # The geo-location where the resource lives - ${Location}, - - [Parameter(ParameterSetName='CreateExpanded')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] - [System.String] - # Human-readable description of the schema registry. - ${Description}, - - [Parameter(ParameterSetName='CreateExpanded')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] - [System.String] - # Human-readable display name. - ${DisplayName}, - - [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] [System.Management.Automation.SwitchParameter] # Determines whether to enable a system-assigned identity for the resource. @@ -7856,7 +6839,6 @@ INPUTOBJECT : Identity Parameter [Location ]: The name of the Azure region. [NamespaceName ]: The name of the namespace. [OperationId ]: The ID of an ongoing async operation. - [PolicyName ]: The name of the Policy tracked resource. [ResourceGroupName ]: The name of the resource group. The name is case insensitive. [SchemaName ]: Schema name parameter. [SchemaRegistryName ]: Schema registry name parameter. @@ -8093,7 +7075,6 @@ INPUTOBJECT : Identity Parameter [Location ]: The name of the Azure region. [NamespaceName ]: The name of the namespace. [OperationId ]: The ID of an ongoing async operation. - [PolicyName ]: The name of the Policy tracked resource. [ResourceGroupName ]: The name of the resource group. The name is case insensitive. [SchemaName ]: Schema name parameter. [SchemaRegistryName ]: Schema registry name parameter. @@ -8301,28 +7282,21 @@ end { <# .Synopsis -Delete a Credential +Delete a NamespaceAsset .Description -Delete a Credential -.Example -Remove-AzDeviceRegistryCredentials -NamespaceName my-namespace -ResourceGroupName my-resource-group -.Example -Remove-AzDeviceRegistryCredentials -NamespaceName my-namespace -ResourceGroupName my-resource-group -Confirm +Delete a NamespaceAsset .Example -Remove-AzDeviceRegistryCredentials -NamespaceName my-namespace -ResourceGroupName my-resource-group -Confirm:$false +Remove-AzDeviceRegistryNamespaceAsset -ResourceGroupName "my-resource-group" -NamespaceName "my-namespace" -AssetName "my-asset" .Example -$credentialsIdentity = @{ - SubscriptionId = "xxxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx" +$namespaceIdentity = @{ + SubscriptionId = "12345678-1234-1234-1234-123456789abc" ResourceGroupName = "my-resource-group" NamespaceName = "my-namespace" } -Remove-AzDeviceRegistryCredentials -InputObject $credentialsIdentity -Confirm:$false +Remove-AzDeviceRegistryNamespaceAsset -NamespaceInputObject $namespaceIdentity -AssetName "my-asset" .Example -# First remove all policies -Get-AzDeviceRegistryPolicy -NamespaceName my-namespace -ResourceGroupName my-resource-group | Remove-AzDeviceRegistryPolicy -Confirm:$false - -# Then remove credentials -Remove-AzDeviceRegistryCredentials -NamespaceName my-namespace -ResourceGroupName my-resource-group -Confirm:$false +$asset = Get-AzDeviceRegistryNamespaceAsset -ResourceGroupName "my-resource-group" -NamespaceName "my-namespace" -AssetName "my-asset" +Remove-AzDeviceRegistryNamespaceAsset -InputObject $asset .Inputs Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IDeviceRegistryIdentity @@ -8344,19 +7318,42 @@ INPUTOBJECT : Identity Parameter [Location ]: The name of the Azure region. [NamespaceName ]: The name of the namespace. [OperationId ]: The ID of an ongoing async operation. - [PolicyName ]: The name of the Policy tracked resource. [ResourceGroupName ]: The name of the resource group. The name is case insensitive. [SchemaName ]: Schema name parameter. [SchemaRegistryName ]: Schema registry name parameter. [SchemaVersionName ]: Schema version name parameter. [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. -.Link -https://learn.microsoft.com/powershell/module/az.deviceregistry/remove-azdeviceregistrycredentials -#> -function Remove-AzDeviceRegistryCredentials { -[OutputType([System.Boolean])] -[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] + +NAMESPACEINPUTOBJECT : Identity Parameter + [AssetEndpointProfileName ]: Asset Endpoint Profile name parameter. + [AssetName ]: Asset name parameter. + [BillingContainerName ]: Name of the billing container. + [DeviceName ]: The name of the device. + [DiscoveredAssetName ]: The name of the discovered asset. + [DiscoveredDeviceName ]: The name of the discovered device. + [Id ]: Resource identity path + [Location ]: The name of the Azure region. + [NamespaceName ]: The name of the namespace. + [OperationId ]: The ID of an ongoing async operation. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [SchemaName ]: Schema name parameter. + [SchemaRegistryName ]: Schema registry name parameter. + [SchemaVersionName ]: Schema version name parameter. + [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. +.Link +https://learn.microsoft.com/powershell/module/az.deviceregistry/remove-azdeviceregistrynamespaceasset +#> +function Remove-AzDeviceRegistryNamespaceAsset { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( + [Parameter(ParameterSetName='Delete', Mandatory)] + [Parameter(ParameterSetName='DeleteViaIdentityNamespace', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Path')] + [System.String] + # The name of the asset. + ${AssetName}, + [Parameter(ParameterSetName='Delete', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Path')] [System.String] @@ -8384,6 +7381,12 @@ param( # Identity Parameter ${InputObject}, + [Parameter(ParameterSetName='DeleteViaIdentityNamespace', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IDeviceRegistryIdentity] + # Identity Parameter + ${NamespaceInputObject}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -8486,8 +7489,9 @@ begin { } $mapping = @{ - Delete = 'Az.DeviceRegistry.private\Remove-AzDeviceRegistryCredentials_Delete'; - DeleteViaIdentity = 'Az.DeviceRegistry.private\Remove-AzDeviceRegistryCredentials_DeleteViaIdentity'; + Delete = 'Az.DeviceRegistry.private\Remove-AzDeviceRegistryNamespaceAsset_Delete'; + DeleteViaIdentity = 'Az.DeviceRegistry.private\Remove-AzDeviceRegistryNamespaceAsset_DeleteViaIdentity'; + DeleteViaIdentityNamespace = 'Az.DeviceRegistry.private\Remove-AzDeviceRegistryNamespaceAsset_DeleteViaIdentityNamespace'; } if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { @@ -8551,21 +7555,21 @@ end { <# .Synopsis -Delete a NamespaceAsset +Delete a NamespaceDevice .Description -Delete a NamespaceAsset +Delete a NamespaceDevice .Example -Remove-AzDeviceRegistryNamespaceAsset -ResourceGroupName "my-resource-group" -NamespaceName "my-namespace" -AssetName "my-asset" +Remove-AzDeviceRegistryNamespaceDevice -ResourceGroupName "my-resource-group" -NamespaceName "my-namespace" -DeviceName "my-device" .Example $namespaceIdentity = @{ SubscriptionId = "12345678-1234-1234-1234-123456789abc" ResourceGroupName = "my-resource-group" NamespaceName = "my-namespace" } -Remove-AzDeviceRegistryNamespaceAsset -NamespaceInputObject $namespaceIdentity -AssetName "my-asset" +Remove-AzDeviceRegistryNamespaceDevice -NamespaceInputObject $namespaceIdentity -DeviceName "my-device" .Example -$asset = Get-AzDeviceRegistryNamespaceAsset -ResourceGroupName "my-resource-group" -NamespaceName "my-namespace" -AssetName "my-asset" -Remove-AzDeviceRegistryNamespaceAsset -InputObject $asset +$device = Get-AzDeviceRegistryNamespaceDevice -ResourceGroupName "my-resource-group" -NamespaceName "my-namespace" -DeviceName "my-device" +Remove-AzDeviceRegistryNamespaceDevice -InputObject $device .Inputs Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IDeviceRegistryIdentity @@ -8587,7 +7591,6 @@ INPUTOBJECT : Identity Parameter [Location ]: The name of the Azure region. [NamespaceName ]: The name of the namespace. [OperationId ]: The ID of an ongoing async operation. - [PolicyName ]: The name of the Policy tracked resource. [ResourceGroupName ]: The name of the resource group. The name is case insensitive. [SchemaName ]: Schema name parameter. [SchemaRegistryName ]: Schema registry name parameter. @@ -8605,16 +7608,15 @@ NAMESPACEINPUTOBJECT : Identity Parameter [Location ]: The name of the Azure region. [NamespaceName ]: The name of the namespace. [OperationId ]: The ID of an ongoing async operation. - [PolicyName ]: The name of the Policy tracked resource. [ResourceGroupName ]: The name of the resource group. The name is case insensitive. [SchemaName ]: Schema name parameter. [SchemaRegistryName ]: Schema registry name parameter. [SchemaVersionName ]: Schema version name parameter. [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. .Link -https://learn.microsoft.com/powershell/module/az.deviceregistry/remove-azdeviceregistrynamespaceasset +https://learn.microsoft.com/powershell/module/az.deviceregistry/remove-azdeviceregistrynamespacedevice #> -function Remove-AzDeviceRegistryNamespaceAsset { +function Remove-AzDeviceRegistryNamespaceDevice { [OutputType([System.Boolean])] [CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( @@ -8622,8 +7624,8 @@ param( [Parameter(ParameterSetName='DeleteViaIdentityNamespace', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Path')] [System.String] - # The name of the asset. - ${AssetName}, + # The name of the device. + ${DeviceName}, [Parameter(ParameterSetName='Delete', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Path')] @@ -8760,9 +7762,9 @@ begin { } $mapping = @{ - Delete = 'Az.DeviceRegistry.private\Remove-AzDeviceRegistryNamespaceAsset_Delete'; - DeleteViaIdentity = 'Az.DeviceRegistry.private\Remove-AzDeviceRegistryNamespaceAsset_DeleteViaIdentity'; - DeleteViaIdentityNamespace = 'Az.DeviceRegistry.private\Remove-AzDeviceRegistryNamespaceAsset_DeleteViaIdentityNamespace'; + Delete = 'Az.DeviceRegistry.private\Remove-AzDeviceRegistryNamespaceDevice_Delete'; + DeleteViaIdentity = 'Az.DeviceRegistry.private\Remove-AzDeviceRegistryNamespaceDevice_DeleteViaIdentity'; + DeleteViaIdentityNamespace = 'Az.DeviceRegistry.private\Remove-AzDeviceRegistryNamespaceDevice_DeleteViaIdentityNamespace'; } if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { @@ -8826,21 +7828,21 @@ end { <# .Synopsis -Delete a NamespaceDevice +Delete a NamespaceDiscoveredAsset .Description -Delete a NamespaceDevice +Delete a NamespaceDiscoveredAsset .Example -Remove-AzDeviceRegistryNamespaceDevice -ResourceGroupName "my-resource-group" -NamespaceName "my-namespace" -DeviceName "my-device" +Remove-AzDeviceRegistryNamespaceDiscoveredAsset -ResourceGroupName "my-resource-group" -NamespaceName "my-namespace" -DiscoveredAssetName "my-discovered-asset" .Example $namespaceIdentity = @{ SubscriptionId = "12345678-1234-1234-1234-123456789abc" ResourceGroupName = "my-resource-group" NamespaceName = "my-namespace" } -Remove-AzDeviceRegistryNamespaceDevice -NamespaceInputObject $namespaceIdentity -DeviceName "my-device" +Remove-AzDeviceRegistryNamespaceDiscoveredAsset -NamespaceInputObject $namespaceIdentity -DiscoveredAssetName "my-discovered-asset" .Example -$device = Get-AzDeviceRegistryNamespaceDevice -ResourceGroupName "my-resource-group" -NamespaceName "my-namespace" -DeviceName "my-device" -Remove-AzDeviceRegistryNamespaceDevice -InputObject $device +$discoveredAsset = Get-AzDeviceRegistryNamespaceDiscoveredAsset -ResourceGroupName "my-resource-group" -NamespaceName "my-namespace" -DiscoveredAssetName "my-discovered-asset" +Remove-AzDeviceRegistryNamespaceDiscoveredAsset -InputObject $discoveredAsset .Inputs Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IDeviceRegistryIdentity @@ -8862,7 +7864,6 @@ INPUTOBJECT : Identity Parameter [Location ]: The name of the Azure region. [NamespaceName ]: The name of the namespace. [OperationId ]: The ID of an ongoing async operation. - [PolicyName ]: The name of the Policy tracked resource. [ResourceGroupName ]: The name of the resource group. The name is case insensitive. [SchemaName ]: Schema name parameter. [SchemaRegistryName ]: Schema registry name parameter. @@ -8880,16 +7881,15 @@ NAMESPACEINPUTOBJECT : Identity Parameter [Location ]: The name of the Azure region. [NamespaceName ]: The name of the namespace. [OperationId ]: The ID of an ongoing async operation. - [PolicyName ]: The name of the Policy tracked resource. [ResourceGroupName ]: The name of the resource group. The name is case insensitive. [SchemaName ]: Schema name parameter. [SchemaRegistryName ]: Schema registry name parameter. [SchemaVersionName ]: Schema version name parameter. [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. .Link -https://learn.microsoft.com/powershell/module/az.deviceregistry/remove-azdeviceregistrynamespacedevice +https://learn.microsoft.com/powershell/module/az.deviceregistry/remove-azdeviceregistrynamespacediscoveredasset #> -function Remove-AzDeviceRegistryNamespaceDevice { +function Remove-AzDeviceRegistryNamespaceDiscoveredAsset { [OutputType([System.Boolean])] [CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( @@ -8897,8 +7897,8 @@ param( [Parameter(ParameterSetName='DeleteViaIdentityNamespace', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Path')] [System.String] - # The name of the device. - ${DeviceName}, + # The name of the discovered asset. + ${DiscoveredAssetName}, [Parameter(ParameterSetName='Delete', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Path')] @@ -9035,9 +8035,9 @@ begin { } $mapping = @{ - Delete = 'Az.DeviceRegistry.private\Remove-AzDeviceRegistryNamespaceDevice_Delete'; - DeleteViaIdentity = 'Az.DeviceRegistry.private\Remove-AzDeviceRegistryNamespaceDevice_DeleteViaIdentity'; - DeleteViaIdentityNamespace = 'Az.DeviceRegistry.private\Remove-AzDeviceRegistryNamespaceDevice_DeleteViaIdentityNamespace'; + Delete = 'Az.DeviceRegistry.private\Remove-AzDeviceRegistryNamespaceDiscoveredAsset_Delete'; + DeleteViaIdentity = 'Az.DeviceRegistry.private\Remove-AzDeviceRegistryNamespaceDiscoveredAsset_DeleteViaIdentity'; + DeleteViaIdentityNamespace = 'Az.DeviceRegistry.private\Remove-AzDeviceRegistryNamespaceDiscoveredAsset_DeleteViaIdentityNamespace'; } if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { @@ -9101,21 +8101,21 @@ end { <# .Synopsis -Delete a NamespaceDiscoveredAsset +Delete a NamespaceDiscoveredDevice .Description -Delete a NamespaceDiscoveredAsset +Delete a NamespaceDiscoveredDevice .Example -Remove-AzDeviceRegistryNamespaceDiscoveredAsset -ResourceGroupName "my-resource-group" -NamespaceName "my-namespace" -DiscoveredAssetName "my-discovered-asset" +Remove-AzDeviceRegistryNamespaceDiscoveredDevice -ResourceGroupName "my-resource-group" -NamespaceName "my-namespace" -DiscoveredDeviceName "my-discovered-device" .Example $namespaceIdentity = @{ SubscriptionId = "12345678-1234-1234-1234-123456789abc" ResourceGroupName = "my-resource-group" NamespaceName = "my-namespace" } -Remove-AzDeviceRegistryNamespaceDiscoveredAsset -NamespaceInputObject $namespaceIdentity -DiscoveredAssetName "my-discovered-asset" +Remove-AzDeviceRegistryNamespaceDiscoveredDevice -NamespaceInputObject $namespaceIdentity -DiscoveredDeviceName "my-discovered-device" .Example -$discoveredAsset = Get-AzDeviceRegistryNamespaceDiscoveredAsset -ResourceGroupName "my-resource-group" -NamespaceName "my-namespace" -DiscoveredAssetName "my-discovered-asset" -Remove-AzDeviceRegistryNamespaceDiscoveredAsset -InputObject $discoveredAsset +$discoveredDevice = Get-AzDeviceRegistryNamespaceDiscoveredDevice -ResourceGroupName "my-resource-group" -NamespaceName "my-namespace" -DiscoveredDeviceName "my-discovered-device" +Remove-AzDeviceRegistryNamespaceDiscoveredDevice -InputObject $discoveredDevice .Inputs Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IDeviceRegistryIdentity @@ -9137,7 +8137,6 @@ INPUTOBJECT : Identity Parameter [Location ]: The name of the Azure region. [NamespaceName ]: The name of the namespace. [OperationId ]: The ID of an ongoing async operation. - [PolicyName ]: The name of the Policy tracked resource. [ResourceGroupName ]: The name of the resource group. The name is case insensitive. [SchemaName ]: Schema name parameter. [SchemaRegistryName ]: Schema registry name parameter. @@ -9155,16 +8154,15 @@ NAMESPACEINPUTOBJECT : Identity Parameter [Location ]: The name of the Azure region. [NamespaceName ]: The name of the namespace. [OperationId ]: The ID of an ongoing async operation. - [PolicyName ]: The name of the Policy tracked resource. [ResourceGroupName ]: The name of the resource group. The name is case insensitive. [SchemaName ]: Schema name parameter. [SchemaRegistryName ]: Schema registry name parameter. [SchemaVersionName ]: Schema version name parameter. [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. .Link -https://learn.microsoft.com/powershell/module/az.deviceregistry/remove-azdeviceregistrynamespacediscoveredasset +https://learn.microsoft.com/powershell/module/az.deviceregistry/remove-azdeviceregistrynamespacediscovereddevice #> -function Remove-AzDeviceRegistryNamespaceDiscoveredAsset { +function Remove-AzDeviceRegistryNamespaceDiscoveredDevice { [OutputType([System.Boolean])] [CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( @@ -9172,8 +8170,8 @@ param( [Parameter(ParameterSetName='DeleteViaIdentityNamespace', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Path')] [System.String] - # The name of the discovered asset. - ${DiscoveredAssetName}, + # The name of the discovered device. + ${DiscoveredDeviceName}, [Parameter(ParameterSetName='Delete', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Path')] @@ -9310,9 +8308,9 @@ begin { } $mapping = @{ - Delete = 'Az.DeviceRegistry.private\Remove-AzDeviceRegistryNamespaceDiscoveredAsset_Delete'; - DeleteViaIdentity = 'Az.DeviceRegistry.private\Remove-AzDeviceRegistryNamespaceDiscoveredAsset_DeleteViaIdentity'; - DeleteViaIdentityNamespace = 'Az.DeviceRegistry.private\Remove-AzDeviceRegistryNamespaceDiscoveredAsset_DeleteViaIdentityNamespace'; + Delete = 'Az.DeviceRegistry.private\Remove-AzDeviceRegistryNamespaceDiscoveredDevice_Delete'; + DeleteViaIdentity = 'Az.DeviceRegistry.private\Remove-AzDeviceRegistryNamespaceDiscoveredDevice_DeleteViaIdentity'; + DeleteViaIdentityNamespace = 'Az.DeviceRegistry.private\Remove-AzDeviceRegistryNamespaceDiscoveredDevice_DeleteViaIdentityNamespace'; } if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { @@ -9376,21 +8374,14 @@ end { <# .Synopsis -Delete a NamespaceDiscoveredDevice +Delete a Namespace .Description -Delete a NamespaceDiscoveredDevice -.Example -Remove-AzDeviceRegistryNamespaceDiscoveredDevice -ResourceGroupName "my-resource-group" -NamespaceName "my-namespace" -DiscoveredDeviceName "my-discovered-device" +Delete a Namespace .Example -$namespaceIdentity = @{ - SubscriptionId = "12345678-1234-1234-1234-123456789abc" - ResourceGroupName = "my-resource-group" - NamespaceName = "my-namespace" -} -Remove-AzDeviceRegistryNamespaceDiscoveredDevice -NamespaceInputObject $namespaceIdentity -DiscoveredDeviceName "my-discovered-device" +Remove-AzDeviceRegistryNamespace -Name "my-namespace" -ResourceGroupName "my-resource-group" .Example -$discoveredDevice = Get-AzDeviceRegistryNamespaceDiscoveredDevice -ResourceGroupName "my-resource-group" -NamespaceName "my-namespace" -DiscoveredDeviceName "my-discovered-device" -Remove-AzDeviceRegistryNamespaceDiscoveredDevice -InputObject $discoveredDevice +$namespace = Get-AzDeviceRegistryNamespace -Name "my-namespace" -ResourceGroupName "my-resource-group" +Remove-AzDeviceRegistryNamespace -InputObject $namespace .Inputs Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IDeviceRegistryIdentity @@ -9412,49 +8403,24 @@ INPUTOBJECT : Identity Parameter [Location ]: The name of the Azure region. [NamespaceName ]: The name of the namespace. [OperationId ]: The ID of an ongoing async operation. - [PolicyName ]: The name of the Policy tracked resource. - [ResourceGroupName ]: The name of the resource group. The name is case insensitive. - [SchemaName ]: Schema name parameter. - [SchemaRegistryName ]: Schema registry name parameter. - [SchemaVersionName ]: Schema version name parameter. - [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. - -NAMESPACEINPUTOBJECT : Identity Parameter - [AssetEndpointProfileName ]: Asset Endpoint Profile name parameter. - [AssetName ]: Asset name parameter. - [BillingContainerName ]: Name of the billing container. - [DeviceName ]: The name of the device. - [DiscoveredAssetName ]: The name of the discovered asset. - [DiscoveredDeviceName ]: The name of the discovered device. - [Id ]: Resource identity path - [Location ]: The name of the Azure region. - [NamespaceName ]: The name of the namespace. - [OperationId ]: The ID of an ongoing async operation. - [PolicyName ]: The name of the Policy tracked resource. [ResourceGroupName ]: The name of the resource group. The name is case insensitive. [SchemaName ]: Schema name parameter. [SchemaRegistryName ]: Schema registry name parameter. [SchemaVersionName ]: Schema version name parameter. [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. .Link -https://learn.microsoft.com/powershell/module/az.deviceregistry/remove-azdeviceregistrynamespacediscovereddevice +https://learn.microsoft.com/powershell/module/az.deviceregistry/remove-azdeviceregistrynamespace #> -function Remove-AzDeviceRegistryNamespaceDiscoveredDevice { +function Remove-AzDeviceRegistryNamespace { [OutputType([System.Boolean])] [CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='Delete', Mandatory)] - [Parameter(ParameterSetName='DeleteViaIdentityNamespace', Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Path')] - [System.String] - # The name of the discovered device. - ${DiscoveredDeviceName}, - - [Parameter(ParameterSetName='Delete', Mandatory)] + [Alias('NamespaceName')] [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Path')] [System.String] # The name of the namespace. - ${NamespaceName}, + ${Name}, [Parameter(ParameterSetName='Delete', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Path')] @@ -9477,12 +8443,6 @@ param( # Identity Parameter ${InputObject}, - [Parameter(ParameterSetName='DeleteViaIdentityNamespace', Mandatory, ValueFromPipeline)] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Path')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IDeviceRegistryIdentity] - # Identity Parameter - ${NamespaceInputObject}, - [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -9585,9 +8545,8 @@ begin { } $mapping = @{ - Delete = 'Az.DeviceRegistry.private\Remove-AzDeviceRegistryNamespaceDiscoveredDevice_Delete'; - DeleteViaIdentity = 'Az.DeviceRegistry.private\Remove-AzDeviceRegistryNamespaceDiscoveredDevice_DeleteViaIdentity'; - DeleteViaIdentityNamespace = 'Az.DeviceRegistry.private\Remove-AzDeviceRegistryNamespaceDiscoveredDevice_DeleteViaIdentityNamespace'; + Delete = 'Az.DeviceRegistry.private\Remove-AzDeviceRegistryNamespace_Delete'; + DeleteViaIdentity = 'Az.DeviceRegistry.private\Remove-AzDeviceRegistryNamespace_DeleteViaIdentity'; } if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { @@ -9651,14 +8610,14 @@ end { <# .Synopsis -Delete a Namespace +Delete a SchemaRegistry .Description -Delete a Namespace +Delete a SchemaRegistry .Example -Remove-AzDeviceRegistryNamespace -Name "my-namespace" -ResourceGroupName "my-resource-group" +Remove-AzDeviceRegistrySchemaRegistry -ResourceGroupName "my-resource-group" -SchemaRegistryName "my-schema-registry" .Example -$namespace = Get-AzDeviceRegistryNamespace -Name "my-namespace" -ResourceGroupName "my-resource-group" -Remove-AzDeviceRegistryNamespace -InputObject $namespace +$schemaRegistry = Get-AzDeviceRegistrySchemaRegistry -ResourceGroupName "my-resource-group" -SchemaRegistryName "my-schema-registry" +Remove-AzDeviceRegistrySchemaRegistry -InputObject $schemaRegistry .Inputs Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IDeviceRegistryIdentity @@ -9680,24 +8639,23 @@ INPUTOBJECT : Identity Parameter [Location ]: The name of the Azure region. [NamespaceName ]: The name of the namespace. [OperationId ]: The ID of an ongoing async operation. - [PolicyName ]: The name of the Policy tracked resource. [ResourceGroupName ]: The name of the resource group. The name is case insensitive. [SchemaName ]: Schema name parameter. [SchemaRegistryName ]: Schema registry name parameter. [SchemaVersionName ]: Schema version name parameter. [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. .Link -https://learn.microsoft.com/powershell/module/az.deviceregistry/remove-azdeviceregistrynamespace +https://learn.microsoft.com/powershell/module/az.deviceregistry/remove-azdeviceregistryschemaregistry #> -function Remove-AzDeviceRegistryNamespace { +function Remove-AzDeviceRegistrySchemaRegistry { [OutputType([System.Boolean])] [CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='Delete', Mandatory)] - [Alias('NamespaceName')] + [Alias('SchemaRegistryName')] [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Path')] [System.String] - # The name of the namespace. + # Schema registry name parameter. ${Name}, [Parameter(ParameterSetName='Delete', Mandatory)] @@ -9823,8 +8781,8 @@ begin { } $mapping = @{ - Delete = 'Az.DeviceRegistry.private\Remove-AzDeviceRegistryNamespace_Delete'; - DeleteViaIdentity = 'Az.DeviceRegistry.private\Remove-AzDeviceRegistryNamespace_DeleteViaIdentity'; + Delete = 'Az.DeviceRegistry.private\Remove-AzDeviceRegistrySchemaRegistry_Delete'; + DeleteViaIdentity = 'Az.DeviceRegistry.private\Remove-AzDeviceRegistrySchemaRegistry_DeleteViaIdentity'; } if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { @@ -9888,26 +8846,20 @@ end { <# .Synopsis -Delete a Policy +Delete a SchemaVersion .Description -Delete a Policy -.Example -Remove-AzDeviceRegistryPolicy -Name my-policy -NamespaceName my-namespace -ResourceGroupName my-resource-group +Delete a SchemaVersion .Example -Remove-AzDeviceRegistryPolicy -Name my-policy -NamespaceName my-namespace -ResourceGroupName my-resource-group -Confirm +Remove-AzDeviceRegistrySchemaVersion -ResourceGroupName "my-resource-group" -SchemaRegistryName "my-schema-registry" -SchemaName "my-schema" -Name "1" .Example -Remove-AzDeviceRegistryPolicy -Name my-policy -NamespaceName my-namespace -ResourceGroupName my-resource-group -Confirm:$false +$schemaRegistry = Get-AzDeviceRegistrySchemaRegistry -ResourceGroupName "my-resource-group" -Name "my-schema-registry" +Remove-AzDeviceRegistrySchemaVersion -SchemaRegistryInputObject $schemaRegistry -SchemaName "my-schema" -Name "1" .Example -$policyIdentity = @{ - SubscriptionId = "xxxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx" - ResourceGroupName = "my-resource-group" - NamespaceName = "my-namespace" - CredentialName = "default" - PolicyName = "my-policy-name" -} -Remove-AzDeviceRegistryPolicy -InputObject $policyIdentity -Confirm:$false +$schema = Get-AzDeviceRegistrySchema -ResourceGroupName "my-resource-group" -SchemaRegistryName "my-schema-registry" -Name "my-schema" +Remove-AzDeviceRegistrySchemaVersion -SchemaInputObject $schema -Name "1" .Example -Get-AzDeviceRegistryPolicy -NamespaceName my-namespace -ResourceGroupName my-resource-group | Where-Object { $_.Tag.environment -eq "test" } | Remove-AzDeviceRegistryPolicy -Confirm:$false +$schemaVersion = Get-AzDeviceRegistrySchemaVersion -ResourceGroupName "my-resource-group" -SchemaRegistryName "my-schema-registry" -SchemaName "my-schema" -Name "1" +Remove-AzDeviceRegistrySchemaVersion -InputObject $schemaVersion .Inputs Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IDeviceRegistryIdentity @@ -9929,14 +8881,30 @@ INPUTOBJECT : Identity Parameter [Location ]: The name of the Azure region. [NamespaceName ]: The name of the namespace. [OperationId ]: The ID of an ongoing async operation. - [PolicyName ]: The name of the Policy tracked resource. [ResourceGroupName ]: The name of the resource group. The name is case insensitive. [SchemaName ]: Schema name parameter. [SchemaRegistryName ]: Schema registry name parameter. [SchemaVersionName ]: Schema version name parameter. [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. -NAMESPACEINPUTOBJECT : Identity Parameter +SCHEMAINPUTOBJECT : Identity Parameter + [AssetEndpointProfileName ]: Asset Endpoint Profile name parameter. + [AssetName ]: Asset name parameter. + [BillingContainerName ]: Name of the billing container. + [DeviceName ]: The name of the device. + [DiscoveredAssetName ]: The name of the discovered asset. + [DiscoveredDeviceName ]: The name of the discovered device. + [Id ]: Resource identity path + [Location ]: The name of the Azure region. + [NamespaceName ]: The name of the namespace. + [OperationId ]: The ID of an ongoing async operation. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [SchemaName ]: Schema name parameter. + [SchemaRegistryName ]: Schema registry name parameter. + [SchemaVersionName ]: Schema version name parameter. + [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. + +SCHEMAREGISTRYINPUTOBJECT : Identity Parameter [AssetEndpointProfileName ]: Asset Endpoint Profile name parameter. [AssetName ]: Asset name parameter. [BillingContainerName ]: Name of the billing container. @@ -9947,39 +8915,46 @@ NAMESPACEINPUTOBJECT : Identity Parameter [Location ]: The name of the Azure region. [NamespaceName ]: The name of the namespace. [OperationId ]: The ID of an ongoing async operation. - [PolicyName ]: The name of the Policy tracked resource. [ResourceGroupName ]: The name of the resource group. The name is case insensitive. [SchemaName ]: Schema name parameter. [SchemaRegistryName ]: Schema registry name parameter. [SchemaVersionName ]: Schema version name parameter. [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. .Link -https://learn.microsoft.com/powershell/module/az.deviceregistry/remove-azdeviceregistrypolicy +https://learn.microsoft.com/powershell/module/az.deviceregistry/remove-azdeviceregistryschemaversion #> -function Remove-AzDeviceRegistryPolicy { +function Remove-AzDeviceRegistrySchemaVersion { [OutputType([System.Boolean])] [CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='Delete', Mandatory)] - [Parameter(ParameterSetName='DeleteViaIdentityNamespace', Mandatory)] - [Alias('PolicyName')] + [Parameter(ParameterSetName='DeleteViaIdentitySchema', Mandatory)] + [Parameter(ParameterSetName='DeleteViaIdentitySchemaRegistry', Mandatory)] + [Alias('SchemaVersionName')] [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Path')] [System.String] - # The name of the Policy tracked resource. + # Schema version name parameter. ${Name}, [Parameter(ParameterSetName='Delete', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Path')] [System.String] - # The name of the namespace. - ${NamespaceName}, + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, [Parameter(ParameterSetName='Delete', Mandatory)] + [Parameter(ParameterSetName='DeleteViaIdentitySchemaRegistry', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Path')] [System.String] - # The name of the resource group. - # The name is case insensitive. - ${ResourceGroupName}, + # Schema name parameter. + ${SchemaName}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Path')] + [System.String] + # Schema registry name parameter. + ${SchemaRegistryName}, [Parameter(ParameterSetName='Delete')] [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Path')] @@ -9995,11 +8970,17 @@ param( # Identity Parameter ${InputObject}, - [Parameter(ParameterSetName='DeleteViaIdentityNamespace', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='DeleteViaIdentitySchema', Mandatory, ValueFromPipeline)] [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IDeviceRegistryIdentity] # Identity Parameter - ${NamespaceInputObject}, + ${SchemaInputObject}, + + [Parameter(ParameterSetName='DeleteViaIdentitySchemaRegistry', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IDeviceRegistryIdentity] + # Identity Parameter + ${SchemaRegistryInputObject}, [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] @@ -10103,9 +9084,10 @@ begin { } $mapping = @{ - Delete = 'Az.DeviceRegistry.private\Remove-AzDeviceRegistryPolicy_Delete'; - DeleteViaIdentity = 'Az.DeviceRegistry.private\Remove-AzDeviceRegistryPolicy_DeleteViaIdentity'; - DeleteViaIdentityNamespace = 'Az.DeviceRegistry.private\Remove-AzDeviceRegistryPolicy_DeleteViaIdentityNamespace'; + Delete = 'Az.DeviceRegistry.private\Remove-AzDeviceRegistrySchemaVersion_Delete'; + DeleteViaIdentity = 'Az.DeviceRegistry.private\Remove-AzDeviceRegistrySchemaVersion_DeleteViaIdentity'; + DeleteViaIdentitySchema = 'Az.DeviceRegistry.private\Remove-AzDeviceRegistrySchemaVersion_DeleteViaIdentitySchema'; + DeleteViaIdentitySchemaRegistry = 'Az.DeviceRegistry.private\Remove-AzDeviceRegistrySchemaVersion_DeleteViaIdentitySchemaRegistry'; } if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { @@ -10169,14 +9151,21 @@ end { <# .Synopsis -Delete a SchemaRegistry +Delete a Schema .Description -Delete a SchemaRegistry +Delete a Schema .Example -Remove-AzDeviceRegistrySchemaRegistry -ResourceGroupName "my-resource-group" -SchemaRegistryName "my-schema-registry" +Remove-AzDeviceRegistrySchema -ResourceGroupName "my-resource-group" -RegistryName "my-schema-registry" -Name "my-schema" .Example -$schemaRegistry = Get-AzDeviceRegistrySchemaRegistry -ResourceGroupName "my-resource-group" -SchemaRegistryName "my-schema-registry" -Remove-AzDeviceRegistrySchemaRegistry -InputObject $schemaRegistry +$registryIdentity = @{ + SubscriptionId = "12345678-1234-1234-1234-123456789abc" + ResourceGroupName = "my-resource-group" + SchemaRegistryName = "my-schema-registry" +} +Remove-AzDeviceRegistrySchema -SchemaRegistryInputObject $registryIdentity -Name "my-schema" +.Example +$schema = Get-AzDeviceRegistrySchema -ResourceGroupName "my-resource-group" -RegistryName "my-schema-registry" -Name "my-schema" +Remove-AzDeviceRegistrySchema -InputObject $schema .Inputs Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IDeviceRegistryIdentity @@ -10198,25 +9187,49 @@ INPUTOBJECT : Identity Parameter [Location ]: The name of the Azure region. [NamespaceName ]: The name of the namespace. [OperationId ]: The ID of an ongoing async operation. - [PolicyName ]: The name of the Policy tracked resource. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [SchemaName ]: Schema name parameter. + [SchemaRegistryName ]: Schema registry name parameter. + [SchemaVersionName ]: Schema version name parameter. + [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. + +SCHEMAREGISTRYINPUTOBJECT : Identity Parameter + [AssetEndpointProfileName ]: Asset Endpoint Profile name parameter. + [AssetName ]: Asset name parameter. + [BillingContainerName ]: Name of the billing container. + [DeviceName ]: The name of the device. + [DiscoveredAssetName ]: The name of the discovered asset. + [DiscoveredDeviceName ]: The name of the discovered device. + [Id ]: Resource identity path + [Location ]: The name of the Azure region. + [NamespaceName ]: The name of the namespace. + [OperationId ]: The ID of an ongoing async operation. [ResourceGroupName ]: The name of the resource group. The name is case insensitive. [SchemaName ]: Schema name parameter. [SchemaRegistryName ]: Schema registry name parameter. [SchemaVersionName ]: Schema version name parameter. [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. .Link -https://learn.microsoft.com/powershell/module/az.deviceregistry/remove-azdeviceregistryschemaregistry +https://learn.microsoft.com/powershell/module/az.deviceregistry/remove-azdeviceregistryschema #> -function Remove-AzDeviceRegistrySchemaRegistry { +function Remove-AzDeviceRegistrySchema { [OutputType([System.Boolean])] [CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( + [Parameter(ParameterSetName='Delete', Mandatory)] + [Parameter(ParameterSetName='DeleteViaIdentitySchemaRegistry', Mandatory)] + [Alias('SchemaName')] + [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Path')] + [System.String] + # Schema name parameter. + ${Name}, + [Parameter(ParameterSetName='Delete', Mandatory)] [Alias('SchemaRegistryName')] [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Path')] [System.String] # Schema registry name parameter. - ${Name}, + ${RegistryName}, [Parameter(ParameterSetName='Delete', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Path')] @@ -10239,6 +9252,12 @@ param( # Identity Parameter ${InputObject}, + [Parameter(ParameterSetName='DeleteViaIdentitySchemaRegistry', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IDeviceRegistryIdentity] + # Identity Parameter + ${SchemaRegistryInputObject}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -10341,8 +9360,9 @@ begin { } $mapping = @{ - Delete = 'Az.DeviceRegistry.private\Remove-AzDeviceRegistrySchemaRegistry_Delete'; - DeleteViaIdentity = 'Az.DeviceRegistry.private\Remove-AzDeviceRegistrySchemaRegistry_DeleteViaIdentity'; + Delete = 'Az.DeviceRegistry.private\Remove-AzDeviceRegistrySchema_Delete'; + DeleteViaIdentity = 'Az.DeviceRegistry.private\Remove-AzDeviceRegistrySchema_DeleteViaIdentity'; + DeleteViaIdentitySchemaRegistry = 'Az.DeviceRegistry.private\Remove-AzDeviceRegistrySchema_DeleteViaIdentitySchemaRegistry'; } if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { @@ -10406,25 +9426,28 @@ end { <# .Synopsis -Delete a SchemaVersion +Update a AssetEndpointProfile .Description -Delete a SchemaVersion +Update a AssetEndpointProfile .Example -Remove-AzDeviceRegistrySchemaVersion -ResourceGroupName "my-resource-group" -SchemaRegistryName "my-schema-registry" -SchemaName "my-schema" -Name "1" +Update-AzDeviceRegistryAssetEndpointProfile -Name test-assetendpointprofile -ResourceGroupName test-rg -TargetAddress "opc.tcp://bar" .Example -$schemaRegistry = Get-AzDeviceRegistrySchemaRegistry -ResourceGroupName "my-resource-group" -Name "my-schema-registry" -Remove-AzDeviceRegistrySchemaVersion -SchemaRegistryInputObject $schemaRegistry -SchemaName "my-schema" -Name "1" +$assetEndpointProfile = @{ "ResourceGroupName" = "test-rg"; "AssetEndpointProfileName" = "test-assetendpointprofile"; "SubscriptionId" = "xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxx"; } +Update-AzDeviceRegistryAssetEndpointProfile -InputObject $assetEndpointProfile -TargetAddress "opc.tcp://bar" .Example -$schema = Get-AzDeviceRegistrySchema -ResourceGroupName "my-resource-group" -SchemaRegistryName "my-schema-registry" -Name "my-schema" -Remove-AzDeviceRegistrySchemaVersion -SchemaInputObject $schema -Name "1" +Update-AzDeviceRegistryAssetEndpointProfile -Name test-assetendpointprofile -ResourceGroupName test-rg -JsonFilePath "C:\Users\abc\Desktop\assetEndpointProfilePatch.json" .Example -$schemaVersion = Get-AzDeviceRegistrySchemaVersion -ResourceGroupName "my-resource-group" -SchemaRegistryName "my-schema-registry" -SchemaName "my-schema" -Name "1" -Remove-AzDeviceRegistrySchemaVersion -InputObject $schemaVersion +$jsonStr = '{ + "properties": { + "targetAddress": "opc.tcp://bar" + } +}' +Update-AzDeviceRegistryAssetEndpointProfile -Name test-assetendpointprofile -ResourceGroupName test-rg -JsonString $jsonStr .Inputs Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IDeviceRegistryIdentity .Outputs -System.Boolean +Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetEndpointProfile .Notes COMPLEX PARAMETER PROPERTIES @@ -10441,85 +9464,39 @@ INPUTOBJECT : Identity Parameter [Location ]: The name of the Azure region. [NamespaceName ]: The name of the namespace. [OperationId ]: The ID of an ongoing async operation. - [PolicyName ]: The name of the Policy tracked resource. - [ResourceGroupName ]: The name of the resource group. The name is case insensitive. - [SchemaName ]: Schema name parameter. - [SchemaRegistryName ]: Schema registry name parameter. - [SchemaVersionName ]: Schema version name parameter. - [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. - -SCHEMAINPUTOBJECT : Identity Parameter - [AssetEndpointProfileName ]: Asset Endpoint Profile name parameter. - [AssetName ]: Asset name parameter. - [BillingContainerName ]: Name of the billing container. - [DeviceName ]: The name of the device. - [DiscoveredAssetName ]: The name of the discovered asset. - [DiscoveredDeviceName ]: The name of the discovered device. - [Id ]: Resource identity path - [Location ]: The name of the Azure region. - [NamespaceName ]: The name of the namespace. - [OperationId ]: The ID of an ongoing async operation. - [PolicyName ]: The name of the Policy tracked resource. - [ResourceGroupName ]: The name of the resource group. The name is case insensitive. - [SchemaName ]: Schema name parameter. - [SchemaRegistryName ]: Schema registry name parameter. - [SchemaVersionName ]: Schema version name parameter. - [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. - -SCHEMAREGISTRYINPUTOBJECT : Identity Parameter - [AssetEndpointProfileName ]: Asset Endpoint Profile name parameter. - [AssetName ]: Asset name parameter. - [BillingContainerName ]: Name of the billing container. - [DeviceName ]: The name of the device. - [DiscoveredAssetName ]: The name of the discovered asset. - [DiscoveredDeviceName ]: The name of the discovered device. - [Id ]: Resource identity path - [Location ]: The name of the Azure region. - [NamespaceName ]: The name of the namespace. - [OperationId ]: The ID of an ongoing async operation. - [PolicyName ]: The name of the Policy tracked resource. [ResourceGroupName ]: The name of the resource group. The name is case insensitive. [SchemaName ]: Schema name parameter. [SchemaRegistryName ]: Schema registry name parameter. [SchemaVersionName ]: Schema version name parameter. [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. .Link -https://learn.microsoft.com/powershell/module/az.deviceregistry/remove-azdeviceregistryschemaversion +https://learn.microsoft.com/powershell/module/az.deviceregistry/update-azdeviceregistryassetendpointprofile #> -function Remove-AzDeviceRegistrySchemaVersion { -[OutputType([System.Boolean])] -[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +function Update-AzDeviceRegistryAssetEndpointProfile { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetEndpointProfile])] +[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( - [Parameter(ParameterSetName='Delete', Mandatory)] - [Parameter(ParameterSetName='DeleteViaIdentitySchema', Mandatory)] - [Parameter(ParameterSetName='DeleteViaIdentitySchemaRegistry', Mandatory)] - [Alias('SchemaVersionName')] + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] + [Alias('AssetEndpointProfileName')] [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Path')] [System.String] - # Schema version name parameter. + # Asset Endpoint Profile name parameter. ${Name}, - [Parameter(ParameterSetName='Delete', Mandatory)] + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Path')] [System.String] # The name of the resource group. # The name is case insensitive. ${ResourceGroupName}, - [Parameter(ParameterSetName='Delete', Mandatory)] - [Parameter(ParameterSetName='DeleteViaIdentitySchemaRegistry', Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Path')] - [System.String] - # Schema name parameter. - ${SchemaName}, - - [Parameter(ParameterSetName='Delete', Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Path')] - [System.String] - # Schema registry name parameter. - ${SchemaRegistryName}, - - [Parameter(ParameterSetName='Delete')] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaJsonFilePath')] + [Parameter(ParameterSetName='UpdateViaJsonString')] [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] @@ -10527,23 +9504,85 @@ param( # The value must be an UUID. ${SubscriptionId}, - [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory, ValueFromPipeline)] [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IDeviceRegistryIdentity] # Identity Parameter ${InputObject}, - [Parameter(ParameterSetName='DeleteViaIdentitySchema', Mandatory, ValueFromPipeline)] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Path')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IDeviceRegistryIdentity] - # Identity Parameter - ${SchemaInputObject}, + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] + [System.String] + # Stringified JSON that contains connectivity type specific further configuration (e.g. + # OPC UA, Modbus, ONVIF). + ${AdditionalConfiguration}, - [Parameter(ParameterSetName='DeleteViaIdentitySchemaRegistry', Mandatory, ValueFromPipeline)] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Path')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IDeviceRegistryIdentity] - # Identity Parameter - ${SchemaRegistryInputObject}, + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.PSArgumentCompleterAttribute("Anonymous", "Certificate", "UsernamePassword")] + [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] + [System.String] + # Defines the method to authenticate the user of the client at the server. + ${AuthenticationMethod}, + + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] + [System.String] + # Defines the configuration for the connector type that is being used with the endpoint profile. + ${EndpointProfileType}, + + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetEndpointProfileUpdateTags]))] + [System.Collections.Hashtable] + # Resource tags. + ${Tag}, + + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] + [System.String] + # The local valid URI specifying the network address/DNS name of a southbound device. + # The scheme part of the targetAddress URI specifies the type of the device. + # The additionalConfiguration field holds further connector type specific configuration. + ${TargetAddress}, + + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] + [System.String] + # The name of the secret containing the password. + ${UsernamePasswordCredentialsPasswordSecretName}, + + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] + [System.String] + # The name of the secret containing the username. + ${UsernamePasswordCredentialsUsernameSecretName}, + + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] + [System.String] + # The name of the secret containing the certificate and private key (e.g. + # stored as .der/.pem or .der/.pfx). + ${X509CredentialsCertificateSecretName}, + + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] + [System.String] + # Path of Json file supplied to the Update operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] + [System.String] + # Json string supplied to the Update operation + ${JsonString}, [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] @@ -10586,13 +9625,7 @@ param( # Run the command asynchronously ${NoWait}, - [Parameter()] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Runtime')] - [System.Management.Automation.SwitchParameter] - # Returns true when the command succeeds - ${PassThru}, - - [Parameter(DontShow)] + [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Runtime')] [System.Uri] # The URI for the proxy server to use @@ -10647,12 +9680,12 @@ begin { } $mapping = @{ - Delete = 'Az.DeviceRegistry.private\Remove-AzDeviceRegistrySchemaVersion_Delete'; - DeleteViaIdentity = 'Az.DeviceRegistry.private\Remove-AzDeviceRegistrySchemaVersion_DeleteViaIdentity'; - DeleteViaIdentitySchema = 'Az.DeviceRegistry.private\Remove-AzDeviceRegistrySchemaVersion_DeleteViaIdentitySchema'; - DeleteViaIdentitySchemaRegistry = 'Az.DeviceRegistry.private\Remove-AzDeviceRegistrySchemaVersion_DeleteViaIdentitySchemaRegistry'; + UpdateExpanded = 'Az.DeviceRegistry.private\Update-AzDeviceRegistryAssetEndpointProfile_UpdateExpanded'; + UpdateViaIdentityExpanded = 'Az.DeviceRegistry.private\Update-AzDeviceRegistryAssetEndpointProfile_UpdateViaIdentityExpanded'; + UpdateViaJsonFilePath = 'Az.DeviceRegistry.private\Update-AzDeviceRegistryAssetEndpointProfile_UpdateViaJsonFilePath'; + UpdateViaJsonString = 'Az.DeviceRegistry.private\Update-AzDeviceRegistryAssetEndpointProfile_UpdateViaJsonString'; } - if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { + if (('UpdateExpanded', 'UpdateViaJsonFilePath', 'UpdateViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -10714,50 +9747,50 @@ end { <# .Synopsis -Delete a Schema +Update a Asset .Description -Delete a Schema +Update a Asset .Example -Remove-AzDeviceRegistrySchema -ResourceGroupName "my-resource-group" -RegistryName "my-schema-registry" -Name "my-schema" +Update-AzDeviceRegistryAsset -Name test-asset -ResourceGroupName test-rg -Model ContosoModel2 .Example -$registryIdentity = @{ - SubscriptionId = "12345678-1234-1234-1234-123456789abc" - ResourceGroupName = "my-resource-group" - SchemaRegistryName = "my-schema-registry" -} -Remove-AzDeviceRegistrySchema -SchemaRegistryInputObject $registryIdentity -Name "my-schema" +$asset = @{ "ResourceGroupName" = "test-rg"; "AssetName" = "test-asset"; "SubscriptionId" = "xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxx"; } +Update-AzDeviceRegistryAsset -InputObject $asset -Model ContosoModel2 .Example -$schema = Get-AzDeviceRegistrySchema -ResourceGroupName "my-resource-group" -RegistryName "my-schema-registry" -Name "my-schema" -Remove-AzDeviceRegistrySchema -InputObject $schema +Update-AzDeviceRegistryAsset -Name test-asset -ResourceGroupName test-rg -JsonFilePath "C:\Users\abc\Desktop\assetPatch.json" +.Example +$jsonStr = '{ + "properties": { + "model": "ContosoModel2" + } +}' +Update-AzDeviceRegistryAsset -Name test-asset -ResourceGroupName test-rg -JsonString $jsonStr .Inputs Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IDeviceRegistryIdentity .Outputs -System.Boolean +Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAsset .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 - [AssetEndpointProfileName ]: Asset Endpoint Profile name parameter. - [AssetName ]: Asset name parameter. - [BillingContainerName ]: Name of the billing container. - [DeviceName ]: The name of the device. - [DiscoveredAssetName ]: The name of the discovered asset. - [DiscoveredDeviceName ]: The name of the discovered device. - [Id ]: Resource identity path - [Location ]: The name of the Azure region. - [NamespaceName ]: The name of the namespace. - [OperationId ]: The ID of an ongoing async operation. - [PolicyName ]: The name of the Policy tracked resource. - [ResourceGroupName ]: The name of the resource group. The name is case insensitive. - [SchemaName ]: Schema name parameter. - [SchemaRegistryName ]: Schema registry name parameter. - [SchemaVersionName ]: Schema version name parameter. - [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. +DATASET : Array of datasets that are part of the asset. Each dataset describes the data points that make up the set. + Name : Name of the dataset. + [Configuration ]: Stringified JSON that contains connector-specific JSON string that describes configuration for the specific dataset. + [DataPoint >]: Array of data points that are part of the dataset. Each data point can have per-data point configuration. + [ObservabilityMode ]: An indication of how the data point should be mapped to OpenTelemetry. + [TopicPath ]: The topic path for messages published to an MQTT broker. + [TopicRetain ]: When set to 'Keep', messages published to an MQTT broker will have the retain flag set. Default: 'Never'. -SCHEMAREGISTRYINPUTOBJECT : Identity Parameter +EVENT : Array of events that are part of the asset. Each event can have per-event configuration. + Name : The name of the event. + Notifier : The address of the notifier of the event in the asset (e.g. URL) so that a client can access the event on the asset. + [Configuration ]: Stringified JSON that contains connector-specific configuration for the event. For OPC UA, this could include configuration like, publishingInterval, samplingInterval, and queueSize. + [TopicPath ]: The topic path for messages published to an MQTT broker. + [TopicRetain ]: When set to 'Keep', messages published to an MQTT broker will have the retain flag set. Default: 'Never'. + [ObservabilityMode ]: An indication of how the event should be mapped to OpenTelemetry. + +INPUTOBJECT : Identity Parameter [AssetEndpointProfileName ]: Asset Endpoint Profile name parameter. [AssetName ]: Asset name parameter. [BillingContainerName ]: Name of the billing container. @@ -10768,42 +9801,39 @@ SCHEMAREGISTRYINPUTOBJECT : Identity Parameter [Location ]: The name of the Azure region. [NamespaceName ]: The name of the namespace. [OperationId ]: The ID of an ongoing async operation. - [PolicyName ]: The name of the Policy tracked resource. [ResourceGroupName ]: The name of the resource group. The name is case insensitive. [SchemaName ]: Schema name parameter. [SchemaRegistryName ]: Schema registry name parameter. [SchemaVersionName ]: Schema version name parameter. [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. .Link -https://learn.microsoft.com/powershell/module/az.deviceregistry/remove-azdeviceregistryschema +https://learn.microsoft.com/powershell/module/az.deviceregistry/update-azdeviceregistryasset #> -function Remove-AzDeviceRegistrySchema { -[OutputType([System.Boolean])] -[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +function Update-AzDeviceRegistryAsset { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAsset])] +[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( - [Parameter(ParameterSetName='Delete', Mandatory)] - [Parameter(ParameterSetName='DeleteViaIdentitySchemaRegistry', Mandatory)] - [Alias('SchemaName')] + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] + [Alias('AssetName')] [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Path')] [System.String] - # Schema name parameter. + # Asset name parameter. ${Name}, - [Parameter(ParameterSetName='Delete', Mandatory)] - [Alias('SchemaRegistryName')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Path')] - [System.String] - # Schema registry name parameter. - ${RegistryName}, - - [Parameter(ParameterSetName='Delete', Mandatory)] + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Path')] [System.String] # The name of the resource group. # The name is case insensitive. ${ResourceGroupName}, - [Parameter(ParameterSetName='Delete')] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaJsonFilePath')] + [Parameter(ParameterSetName='UpdateViaJsonString')] [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] @@ -10811,255 +9841,166 @@ param( # The value must be an UUID. ${SubscriptionId}, - [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory, ValueFromPipeline)] [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IDeviceRegistryIdentity] # Identity Parameter ${InputObject}, - [Parameter(ParameterSetName='DeleteViaIdentitySchemaRegistry', Mandatory, ValueFromPipeline)] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Path')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IDeviceRegistryIdentity] - # Identity Parameter - ${SchemaRegistryInputObject}, - - [Parameter()] - [Alias('AzureRMContext', 'AzureCredential')] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetUpdatePropertiesAttributes]))] + [System.Collections.Hashtable] + # A set of key-value pairs that contain custom attributes set by the customer. + ${Attribute}, - [Parameter()] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Runtime')] - [System.Management.Automation.SwitchParameter] - # Run the command as a job - ${AsJob}, + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IDataset[]] + # Array of datasets that are part of the asset. + # Each dataset describes the data points that make up the set. + ${Dataset}, - [Parameter(DontShow)] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Runtime')] - [System.Management.Automation.SwitchParameter] - # Wait for .NET debugger to attach - ${Break}, + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] + [System.String] + # Stringified JSON that contains connector-specific default configuration for all datasets. + # Each dataset can have its own configuration that overrides the default settings here. + ${DefaultDatasetsConfiguration}, - [Parameter(DontShow)] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Runtime')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SendAsyncStep[]] - # SendAsync Pipeline Steps to be appended to the front of the pipeline - ${HttpPipelineAppend}, + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] + [System.String] + # Stringified JSON that contains connector-specific default configuration for all events. + # Each event can have its own configuration that overrides the default settings here. + ${DefaultEventsConfiguration}, - [Parameter(DontShow)] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Runtime')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SendAsyncStep[]] - # SendAsync Pipeline Steps to be prepended to the front of the pipeline - ${HttpPipelinePrepend}, + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] + [System.String] + # The topic path for messages published to an MQTT broker. + ${DefaultTopicPath}, - [Parameter()] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Runtime')] - [System.Management.Automation.SwitchParameter] - # Run the command asynchronously - ${NoWait}, + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.PSArgumentCompleterAttribute("Keep", "Never")] + [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] + [System.String] + # When set to 'Keep', messages published to an MQTT broker will have the retain flag set. + # Default: 'Never'. + ${DefaultTopicRetain}, - [Parameter()] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Runtime')] - [System.Management.Automation.SwitchParameter] - # Returns true when the command succeeds - ${PassThru}, + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] + [System.String] + # Human-readable description of the asset. + ${Description}, - [Parameter(DontShow)] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Runtime')] - [System.Uri] - # The URI for the proxy server to use - ${Proxy}, + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] + [System.String] + # Human-readable display name. + ${DisplayName}, - [Parameter(DontShow)] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Runtime')] - [System.Management.Automation.PSCredential] - # Credentials for a proxy server to use for the remote call - ${ProxyCredential}, + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] + [System.String] + # Reference to the documentation. + ${DocumentationUri}, - [Parameter(DontShow)] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Runtime')] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] [System.Management.Automation.SwitchParameter] - # Use the default credentials for the proxy - ${ProxyUseDefaultCredentials} -) + # Enabled/Disabled status of the asset. + ${Enabled}, -begin { - try { - $outBuffer = $null - if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { - $PSBoundParameters['OutBuffer'] = 1 - } - $parameterSet = $PSCmdlet.ParameterSetName - - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IEvent[]] + # Array of events that are part of the asset. + # Each event can have per-event configuration. + ${Event}, - $context = Get-AzContext - if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit - } - - if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() - } - $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId - if ($preTelemetryId -eq '') { - [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.private\Remove-AzDeviceRegistrySchema_Delete'; - DeleteViaIdentity = 'Az.DeviceRegistry.private\Remove-AzDeviceRegistrySchema_DeleteViaIdentity'; - DeleteViaIdentitySchemaRegistry = 'Az.DeviceRegistry.private\Remove-AzDeviceRegistrySchema_DeleteViaIdentitySchemaRegistry'; - } - if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { - 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.DeviceRegistry.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.DeviceRegistry.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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) - if ($wrappedCmd -eq $null) { - $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) - } - $scriptCmd = {& $wrappedCmd @PSBoundParameters} - $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) - $steppablePipeline.Begin($PSCmdlet) - } 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.DeviceRegistry.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) - [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() - } - [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] + [System.String] + # Revision number of the hardware. + ${HardwareRevision}, - } catch { - [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() - throw - } -} -} + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] + [System.String] + # Asset manufacturer name. + ${Manufacturer}, -<# -.Synopsis -A long-running resource action. -.Description -A long-running resource action. -.Example -Sync-AzDeviceRegistryCredentials -NamespaceName my-namespace -ResourceGroupName my-resource-group -.Example -Sync-AzDeviceRegistryCredentials -NamespaceName my-namespace -ResourceGroupName my-resource-group -Verbose -.Example -Get-AzDeviceRegistryCredentials -NamespaceName my-namespace -ResourceGroupName my-resource-group | Sync-AzDeviceRegistryCredentials + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] + [System.String] + # Asset manufacturer URI. + ${ManufacturerUri}, -.Inputs -Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IDeviceRegistryIdentity -.Outputs -System.Boolean -.Notes -COMPLEX PARAMETER PROPERTIES + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] + [System.String] + # Asset model name. + ${Model}, -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. + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] + [System.String] + # Asset product code. + ${ProductCode}, -INPUTOBJECT : Identity Parameter - [AssetEndpointProfileName ]: Asset Endpoint Profile name parameter. - [AssetName ]: Asset name parameter. - [BillingContainerName ]: Name of the billing container. - [DeviceName ]: The name of the device. - [DiscoveredAssetName ]: The name of the discovered asset. - [DiscoveredDeviceName ]: The name of the discovered device. - [Id ]: Resource identity path - [Location ]: The name of the Azure region. - [NamespaceName ]: The name of the namespace. - [OperationId ]: The ID of an ongoing async operation. - [PolicyName ]: The name of the Policy tracked resource. - [ResourceGroupName ]: The name of the resource group. The name is case insensitive. - [SchemaName ]: Schema name parameter. - [SchemaRegistryName ]: Schema registry name parameter. - [SchemaVersionName ]: Schema version name parameter. - [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. -.Link -https://learn.microsoft.com/powershell/module/az.deviceregistry/sync-azdeviceregistrycredentials -#> -function Sync-AzDeviceRegistryCredentials { -[OutputType([System.Boolean])] -[CmdletBinding(DefaultParameterSetName='Synchronize', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] -param( - [Parameter(ParameterSetName='Synchronize', Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Path')] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] [System.String] - # The name of the namespace. - ${NamespaceName}, + # Asset serial number. + ${SerialNumber}, - [Parameter(ParameterSetName='Synchronize', Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Path')] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] [System.String] - # The name of the resource group. - # The name is case insensitive. - ${ResourceGroupName}, + # Revision number of the software. + ${SoftwareRevision}, - [Parameter(ParameterSetName='Synchronize')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Path')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetUpdateTags]))] + [System.Collections.Hashtable] + # Resource tags. + ${Tag}, + + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] [System.String] - # The ID of the target subscription. - # The value must be an UUID. - ${SubscriptionId}, + # Path of Json file supplied to the Update operation + ${JsonFilePath}, - [Parameter(ParameterSetName='SynchronizeViaIdentity', Mandatory, ValueFromPipeline)] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Path')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IDeviceRegistryIdentity] - # Identity Parameter - ${InputObject}, + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] + [System.String] + # Json string supplied to the Update operation + ${JsonString}, [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] @@ -11102,12 +10043,6 @@ param( # Run the command asynchronously ${NoWait}, - [Parameter()] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Runtime')] - [System.Management.Automation.SwitchParameter] - # Returns true when the command succeeds - ${PassThru}, - [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Runtime')] [System.Uri] @@ -11163,10 +10098,12 @@ begin { } $mapping = @{ - Synchronize = 'Az.DeviceRegistry.private\Sync-AzDeviceRegistryCredentials_Synchronize'; - SynchronizeViaIdentity = 'Az.DeviceRegistry.private\Sync-AzDeviceRegistryCredentials_SynchronizeViaIdentity'; + UpdateExpanded = 'Az.DeviceRegistry.private\Update-AzDeviceRegistryAsset_UpdateExpanded'; + UpdateViaIdentityExpanded = 'Az.DeviceRegistry.private\Update-AzDeviceRegistryAsset_UpdateViaIdentityExpanded'; + UpdateViaJsonFilePath = 'Az.DeviceRegistry.private\Update-AzDeviceRegistryAsset_UpdateViaJsonFilePath'; + UpdateViaJsonString = 'Az.DeviceRegistry.private\Update-AzDeviceRegistryAsset_UpdateViaJsonString'; } - if (('Synchronize') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { + if (('UpdateExpanded', 'UpdateViaJsonFilePath', 'UpdateViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -11228,65 +10165,155 @@ end { <# .Synopsis -Update a AssetEndpointProfile +Update a NamespaceAsset .Description -Update a AssetEndpointProfile +Update a NamespaceAsset .Example -Update-AzDeviceRegistryAssetEndpointProfile -Name test-assetendpointprofile -ResourceGroupName test-rg -TargetAddress "opc.tcp://bar" +Update-AzDeviceRegistryNamespaceAsset -ResourceGroupName "my-resource-group" -NamespaceName "my-namespace" -AssetName "my-asset" -DocumentationUri "https://www.example.com/docs" -DisplayName "My Updated Asset" .Example -$assetEndpointProfile = @{ "ResourceGroupName" = "test-rg"; "AssetEndpointProfileName" = "test-assetendpointprofile"; "SubscriptionId" = "xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxx"; } -Update-AzDeviceRegistryAssetEndpointProfile -InputObject $assetEndpointProfile -TargetAddress "opc.tcp://bar" +$updateJson = '{ + "properties": { + "documentationUri": "https://www.example.com/docs", + "displayName": "My Updated Asset" + } +}' +Update-AzDeviceRegistryNamespaceAsset -ResourceGroupName "my-resource-group" -NamespaceName "my-namespace" -AssetName "my-asset" -JsonString $updateJson .Example -Update-AzDeviceRegistryAssetEndpointProfile -Name test-assetendpointprofile -ResourceGroupName test-rg -JsonFilePath "C:\Users\abc\Desktop\assetEndpointProfilePatch.json" +Update-AzDeviceRegistryNamespaceAsset -ResourceGroupName "my-resource-group" -NamespaceName "my-namespace" -AssetName "my-asset" -JsonFilePath "C:\path\to\update-asset.json" .Example -$jsonStr = '{ - "properties": { - "targetAddress": "opc.tcp://bar" - } -}' -Update-AzDeviceRegistryAssetEndpointProfile -Name test-assetendpointprofile -ResourceGroupName test-rg -JsonString $jsonStr +$namespaceIdentity = @{ + SubscriptionId = "00000000-0000-0000-0000-000000000000" + ResourceGroupName = "my-resource-group" + NamespaceName = "my-namespace" +} +Update-AzDeviceRegistryNamespaceAsset -NamespaceInputObject $namespaceIdentity -AssetName "my-asset" -DocumentationUri "https://www.example.com/docs" -DisplayName "My Updated Asset" +.Example +Update-AzDeviceRegistryNamespaceAsset -InputObject $assetObject -DocumentationUri "https://www.example.com/docs" -DisplayName "My Updated Asset" .Inputs Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IDeviceRegistryIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetEndpointProfile +Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceAsset .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 - [AssetEndpointProfileName ]: Asset Endpoint Profile name parameter. - [AssetName ]: Asset name parameter. - [BillingContainerName ]: Name of the billing container. - [DeviceName ]: The name of the device. - [DiscoveredAssetName ]: The name of the discovered asset. - [DiscoveredDeviceName ]: The name of the discovered device. - [Id ]: Resource identity path - [Location ]: The name of the Azure region. - [NamespaceName ]: The name of the namespace. - [OperationId ]: The ID of an ongoing async operation. - [PolicyName ]: The name of the Policy tracked resource. - [ResourceGroupName ]: The name of the resource group. The name is case insensitive. - [SchemaName ]: Schema name parameter. - [SchemaRegistryName ]: Schema registry name parameter. - [SchemaVersionName ]: Schema version name parameter. - [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. -.Link -https://learn.microsoft.com/powershell/module/az.deviceregistry/update-azdeviceregistryassetendpointprofile -#> -function Update-AzDeviceRegistryAssetEndpointProfile { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetEndpointProfile])] -[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] -param( - [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] +DATASET : Array of datasets that are part of the asset. Each dataset describes the data points that make up the set. + Name : Name of the dataset. + [DataPoint >]: Array of data points that are part of the dataset. Each data point can have per-data point configuration. + DataSource : The address of the source of the data in the asset (e.g. URL) so that a client can access the data source on the asset. + Name : The name of the data point. + [DataPointConfiguration ]: Stringified JSON that contains connector-specific configuration for the data point. For OPC UA, this could include configuration like, publishingInterval, samplingInterval, and queueSize. + [TypeRef ]: URI or type definition ID. + [DataSource ]: Reference to a data source for a given dataset. + [DatasetConfiguration ]: Stringified JSON that contains connector-specific JSON string that describes configuration for the specific dataset. + [Destination >]: Destinations for a dataset. + Target : Target destination. + [TypeRef ]: URI or type definition ID. + +DEFAULTDATASETSDESTINATION : Default destinations for a dataset. + Target : Target destination. + +DEFAULTEVENTSDESTINATION : Default destinations for an event. + Target : Target destination. + +DEFAULTSTREAMSDESTINATION : Default destinations for a stream. + Target : Target destination. + +EVENTGROUP : Array of event groups that are part of the asset. Each event group can have per-event group configuration. + Name : The name of the event group. + [DataSource ]: The address of the notifier of the event group in the asset (e.g. URL) so that a client can access the event group on the asset. + [DefaultDestination >]: Destinations for events. Default destinations when destinations is not defined at the event level. + Target : Target destination. + [Event >]: Array of events that are part of the event group. + Name : The name of the event. + [DataSource ]: Reference to a data source for a given event. + [Destination >]: Destinations for an event. + [EventConfiguration ]: Stringified JSON that contains connector-specific configuration for the event. For OPC UA, this could include configuration like, publishingInterval, samplingInterval, and queueSize. + [TypeRef ]: URI or type definition ID. + [EventGroupConfiguration ]: Stringified JSON that contains connector-specific configuration for the event group. For OPC UA, this could include configuration like, publishingInterval, samplingInterval, and queueSize. + [TypeRef ]: URI or type definition ID. + +INPUTOBJECT : Identity Parameter + [AssetEndpointProfileName ]: Asset Endpoint Profile name parameter. + [AssetName ]: Asset name parameter. + [BillingContainerName ]: Name of the billing container. + [DeviceName ]: The name of the device. + [DiscoveredAssetName ]: The name of the discovered asset. + [DiscoveredDeviceName ]: The name of the discovered device. + [Id ]: Resource identity path + [Location ]: The name of the Azure region. + [NamespaceName ]: The name of the namespace. + [OperationId ]: The ID of an ongoing async operation. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [SchemaName ]: Schema name parameter. + [SchemaRegistryName ]: Schema registry name parameter. + [SchemaVersionName ]: Schema version name parameter. + [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. + +MANAGEMENTGROUP : Array of management groups that are part of the asset. Each management group can have a per-group configuration. + Name : Name of the management group. + [Action >]: Array of actions that are part of the management group. Each action can have an individual configuration. + Name : Name of the action. + TargetUri : The target URI on which a client can invoke the specific action. + [ActionConfiguration ]: Stringified JSON that contains connector-specific configuration for the action. + [ActionType ]: The type of the action. + [TimeoutInSecond ]: Response timeout for the action. + [Topic ]: The MQTT topic path on which a client will receive the request for the action. + [TypeRef ]: URI or type definition ID. + [Configuration ]: Stringified JSON that contains connector-specific configuration for the management group. + [DataSource ]: Reference to a data source for a given management group. + [DefaultTimeoutInSecond ]: Default response timeout for all actions that are part of the management group. + [DefaultTopic ]: Default MQTT topic path on which a client will receive the request for all actions that are part of the management group. + [TypeRef ]: URI or type definition ID. + +NAMESPACEINPUTOBJECT : Identity Parameter + [AssetEndpointProfileName ]: Asset Endpoint Profile name parameter. + [AssetName ]: Asset name parameter. + [BillingContainerName ]: Name of the billing container. + [DeviceName ]: The name of the device. + [DiscoveredAssetName ]: The name of the discovered asset. + [DiscoveredDeviceName ]: The name of the discovered device. + [Id ]: Resource identity path + [Location ]: The name of the Azure region. + [NamespaceName ]: The name of the namespace. + [OperationId ]: The ID of an ongoing async operation. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [SchemaName ]: Schema name parameter. + [SchemaRegistryName ]: Schema registry name parameter. + [SchemaVersionName ]: Schema version name parameter. + [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. + +STREAM : Array of streams that are part of the asset. Each stream can have a per-stream configuration. + Name : Name of the stream definition. + [Destination >]: Destinations for a stream. + Target : Target destination. + [StreamConfiguration ]: Stringified JSON that contains connector-specific configuration for the specific stream. + [TypeRef ]: URI or type definition ID. +.Link +https://learn.microsoft.com/powershell/module/az.deviceregistry/update-azdeviceregistrynamespaceasset +#> +function Update-AzDeviceRegistryNamespaceAsset { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceAsset])] +[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaIdentityNamespaceExpanded', Mandatory)] [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] - [Alias('AssetEndpointProfileName')] [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Path')] [System.String] - # Asset Endpoint Profile name parameter. - ${Name}, + # The name of the asset. + ${AssetName}, + + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Path')] + [System.String] + # The name of the namespace. + ${NamespaceName}, [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] @@ -11313,100 +10340,262 @@ param( # Identity Parameter ${InputObject}, + [Parameter(ParameterSetName='UpdateViaIdentityNamespaceExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IDeviceRegistryIdentity] + # Identity Parameter + ${NamespaceInputObject}, + [Parameter(ParameterSetName='UpdateExpanded')] [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityNamespaceExpanded')] + [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] - [System.String] - # Stringified JSON that contains connectivity type specific further configuration (e.g. - # OPC UA, Modbus, ONVIF). - ${AdditionalConfiguration}, + [System.String[]] + # URIs or type definition IDs. + ${AssetTypeRef}, [Parameter(ParameterSetName='UpdateExpanded')] [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.PSArgumentCompleterAttribute("Anonymous", "Certificate", "UsernamePassword")] + [Parameter(ParameterSetName='UpdateViaIdentityNamespaceExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] - [System.String] - # Defines the method to authenticate the user of the client at the server. - ${AuthenticationMethod}, + [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceAssetUpdatePropertiesAttributes]))] + [System.Collections.Hashtable] + # A set of key-value pairs that contain custom attributes set by the customer. + ${Attribute}, + + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityNamespaceExpanded')] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDataset[]] + # Array of datasets that are part of the asset. + # Each dataset describes the data points that make up the set. + ${Dataset}, [Parameter(ParameterSetName='UpdateExpanded')] [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityNamespaceExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] [System.String] - # Defines the configuration for the connector type that is being used with the endpoint profile. - ${EndpointProfileType}, + # Stringified JSON that contains connector-specific default configuration for all datasets. + # Each dataset can have its own configuration that overrides the default settings here. + ${DefaultDatasetsConfiguration}, [Parameter(ParameterSetName='UpdateExpanded')] [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityNamespaceExpanded')] + [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetEndpointProfileUpdateTags]))] - [System.Collections.Hashtable] - # Resource tags. - ${Tag}, + [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IDatasetDestination[]] + # Default destinations for a dataset. + ${DefaultDatasetsDestination}, [Parameter(ParameterSetName='UpdateExpanded')] [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityNamespaceExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] [System.String] - # The local valid URI specifying the network address/DNS name of a southbound device. - # The scheme part of the targetAddress URI specifies the type of the device. - # The additionalConfiguration field holds further connector type specific configuration. - ${TargetAddress}, + # Stringified JSON that contains connector-specific default configuration for all events. + # Each event can have its own configuration that overrides the default settings here. + ${DefaultEventsConfiguration}, [Parameter(ParameterSetName='UpdateExpanded')] [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityNamespaceExpanded')] + [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] - [System.String] - # The name of the secret containing the password. - ${UsernamePasswordCredentialsPasswordSecretName}, + [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IEventDestination[]] + # Default destinations for an event. + ${DefaultEventsDestination}, [Parameter(ParameterSetName='UpdateExpanded')] [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityNamespaceExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] [System.String] - # The name of the secret containing the username. - ${UsernamePasswordCredentialsUsernameSecretName}, + # Stringified JSON that contains connector-specific default configuration for all management groups. + # Each management group can have its own configuration that overrides the default settings here. + ${DefaultManagementGroupsConfiguration}, [Parameter(ParameterSetName='UpdateExpanded')] [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityNamespaceExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] [System.String] - # The name of the secret containing the certificate and private key (e.g. - # stored as .der/.pem or .der/.pfx). - ${X509CredentialsCertificateSecretName}, + # Stringified JSON that contains connector-specific default configuration for all streams. + # Each stream can have its own configuration that overrides the default settings here. + ${DefaultStreamsConfiguration}, - [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityNamespaceExpanded')] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IStreamDestination[]] + # Default destinations for a stream. + ${DefaultStreamsDestination}, + + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityNamespaceExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] [System.String] - # Path of Json file supplied to the Update operation - ${JsonFilePath}, + # Human-readable description of the asset. + ${Description}, - [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityNamespaceExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] [System.String] - # Json string supplied to the Update operation - ${JsonString}, + # Human-readable display name. + ${DisplayName}, - [Parameter()] - [Alias('AzureRMContext', 'AzureCredential')] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityNamespaceExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] + [System.String] + # Asset documentation reference. + ${DocumentationUri}, - [Parameter()] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Runtime')] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityNamespaceExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] [System.Management.Automation.SwitchParameter] - # Run the command as a job - ${AsJob}, + # Enabled/disabled status of the asset. + ${Enabled}, - [Parameter(DontShow)] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Runtime')] - [System.Management.Automation.SwitchParameter] - # Wait for .NET debugger to attach - ${Break}, + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityNamespaceExpanded')] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceEventGroup[]] + # Array of event groups that are part of the asset. + # Each event group can have per-event group configuration. + ${EventGroup}, + + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityNamespaceExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] + [System.String] + # Asset hardware revision number. + ${HardwareRevision}, + + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityNamespaceExpanded')] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IManagementGroup[]] + # Array of management groups that are part of the asset. + # Each management group can have a per-group configuration. + ${ManagementGroup}, + + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityNamespaceExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] + [System.String] + # Asset manufacturer. + ${Manufacturer}, + + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityNamespaceExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] + [System.String] + # Asset manufacturer URI. + ${ManufacturerUri}, + + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityNamespaceExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] + [System.String] + # Asset model. + ${Model}, + + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityNamespaceExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] + [System.String] + # Asset product code. + ${ProductCode}, + + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityNamespaceExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] + [System.String] + # Asset serial number. + ${SerialNumber}, + + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityNamespaceExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] + [System.String] + # Asset software revision number. + ${SoftwareRevision}, + + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityNamespaceExpanded')] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceStream[]] + # Array of streams that are part of the asset. + # Each stream can have a per-stream configuration. + ${Stream}, + + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityNamespaceExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceAssetUpdateTags]))] + [System.Collections.Hashtable] + # Resource tags. + ${Tag}, + + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] + [System.String] + # Path of Json file supplied to the Update operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] + [System.String] + # Json string supplied to the Update operation + ${JsonString}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, [Parameter(DontShow)] [ValidateNotNull()] @@ -11483,10 +10672,11 @@ begin { } $mapping = @{ - UpdateExpanded = 'Az.DeviceRegistry.private\Update-AzDeviceRegistryAssetEndpointProfile_UpdateExpanded'; - UpdateViaIdentityExpanded = 'Az.DeviceRegistry.private\Update-AzDeviceRegistryAssetEndpointProfile_UpdateViaIdentityExpanded'; - UpdateViaJsonFilePath = 'Az.DeviceRegistry.private\Update-AzDeviceRegistryAssetEndpointProfile_UpdateViaJsonFilePath'; - UpdateViaJsonString = 'Az.DeviceRegistry.private\Update-AzDeviceRegistryAssetEndpointProfile_UpdateViaJsonString'; + UpdateExpanded = 'Az.DeviceRegistry.private\Update-AzDeviceRegistryNamespaceAsset_UpdateExpanded'; + UpdateViaIdentityExpanded = 'Az.DeviceRegistry.private\Update-AzDeviceRegistryNamespaceAsset_UpdateViaIdentityExpanded'; + UpdateViaIdentityNamespaceExpanded = 'Az.DeviceRegistry.private\Update-AzDeviceRegistryNamespaceAsset_UpdateViaIdentityNamespaceExpanded'; + UpdateViaJsonFilePath = 'Az.DeviceRegistry.private\Update-AzDeviceRegistryNamespaceAsset_UpdateViaJsonFilePath'; + UpdateViaJsonString = 'Az.DeviceRegistry.private\Update-AzDeviceRegistryNamespaceAsset_UpdateViaJsonString'; } if (('UpdateExpanded', 'UpdateViaJsonFilePath', 'UpdateViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { @@ -11550,49 +10740,107 @@ end { <# .Synopsis -Update a Asset +Update a NamespaceDevice .Description -Update a Asset +Update a NamespaceDevice .Example -Update-AzDeviceRegistryAsset -Name test-asset -ResourceGroupName test-rg -Model ContosoModel2 +$endpointsInbound = @{ + "endpoint1" = @{ + Address = "https://my-inbound-endpoint1.westeurope-1.iothub.azure.net" + EndpointType = "Microsoft.Devices/IotHubs" + AuthenticationMethod = "Certificate" + X509CredentialsCertificateSecretName = "my-certificate" + } + "endpoint2" = @{ + Address = "https://myendpoint2.westeurope-1.iothub.azure.net" + EndpointType = "Microsoft.Devices/IotHubs" + AuthenticationMethod = "UsernamePassword" + UsernamePasswordCredentialsUsernameSecretName = "my-username-secret" + UsernamePasswordCredentialsPasswordSecretName = "my-password-secret" + } +} +Update-AzDeviceRegistryNamespaceDevice -ResourceGroupName "my-resource-group" -NamespaceName "my-namespace" -DeviceName "my-device" -OperatingSystemVersion "10.0.19041" -EndpointInbound $endpointsInbound .Example -$asset = @{ "ResourceGroupName" = "test-rg"; "AssetName" = "test-asset"; "SubscriptionId" = "xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxx"; } -Update-AzDeviceRegistryAsset -InputObject $asset -Model ContosoModel2 +$updateJson = '{ + "properties": { + "operatingSystemVersion": "10.0.19041", + "endpointsInbound": { + "endpoint1": { + "address": "https://my-inbound-endpoint1.westeurope-1.iothub.azure.net", + "endpointType": "Microsoft.Devices/IotHubs", + "authentication": { + "method": "Certificate", + "x509Credentials": { + "certificateSecretName": "my-certificate" + } + } + }, + "endpoint2": { + "address": "https://my-inbound-endpoint2.westeurope-1.iothub.azure.net", + "endpointType": "Microsoft.Devices/IotHubs", + "authentication": { + "method": "UsernamePassword", + "usernamePasswordCredentials": { + "usernameSecretName": "my-username-secret", + "passwordSecretName": "my-password-secret" + } + } + } + } + } +}' +Update-AzDeviceRegistryNamespaceDevice -ResourceGroupName "my-resource-group" -NamespaceName "my-namespace" -DeviceName "my-device" -JsonString $updateJson .Example -Update-AzDeviceRegistryAsset -Name test-asset -ResourceGroupName test-rg -JsonFilePath "C:\Users\abc\Desktop\assetPatch.json" +Update-AzDeviceRegistryNamespaceDevice -ResourceGroupName "my-resource-group" -NamespaceName "my-namespace" -DeviceName "my-device" -JsonFilePath "C:\path\to\update-device.json" .Example -$jsonStr = '{ - "properties": { - "model": "ContosoModel2" +$namespaceIdentity = @{ + SubscriptionId = "00000000-0000-0000-0000-000000000000" + ResourceGroupName = "my-resource-group" + NamespaceName = "my-namespace" +} +$endpointsInbound = @{ + "endpoint1" = @{ + Address = "https://my-inbound-endpoint1.westeurope-1.iothub.azure.net" + EndpointType = "Microsoft.Devices/IotHubs" + AuthenticationMethod = "Certificate" + X509CredentialsCertificateSecretName = "my-certificate" } -}' -Update-AzDeviceRegistryAsset -Name test-asset -ResourceGroupName test-rg -JsonString $jsonStr + "endpoint2" = @{ + Address = "https://myendpoint2.westeurope-1.iothub.azure.net" + EndpointType = "Microsoft.Devices/IotHubs" + AuthenticationMethod = "UsernamePassword" + UsernamePasswordCredentialsUsernameSecretName = "my-username-secret" + UsernamePasswordCredentialsPasswordSecretName = "my-password-secret" + } +} +Update-AzDeviceRegistryNamespaceDevice -NamespaceInputObject $namespaceIdentity -DeviceName "my-device" -OperatingSystemVersion "10.0.19041" -EndpointInbound $endpointsInbound +.Example +$endpointsInbound = @{ + "endpoint1" = @{ + Address = "https://my-inbound-endpoint1.westeurope-1.iothub.azure.net" + EndpointType = "Microsoft.Devices/IotHubs" + AuthenticationMethod = "Certificate" + X509CredentialsCertificateSecretName = "my-certificate" + } + "endpoint2" = @{ + Address = "https://myendpoint2.westeurope-1.iothub.azure.net" + EndpointType = "Microsoft.Devices/IotHubs" + AuthenticationMethod = "UsernamePassword" + UsernamePasswordCredentialsUsernameSecretName = "my-username-secret" + UsernamePasswordCredentialsPasswordSecretName = "my-password-secret" + } +} +Update-AzDeviceRegistryNamespaceDevice -InputObject $deviceObject -OperatingSystemVersion "10.0.19041" -EndpointInbound $endpointsInbound .Inputs Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IDeviceRegistryIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAsset +Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDevice .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. -DATASET : Array of datasets that are part of the asset. Each dataset describes the data points that make up the set. - Name : Name of the dataset. - [Configuration ]: Stringified JSON that contains connector-specific JSON string that describes configuration for the specific dataset. - [DataPoint >]: Array of data points that are part of the dataset. Each data point can have per-data point configuration. - [ObservabilityMode ]: An indication of how the data point should be mapped to OpenTelemetry. - [TopicPath ]: The topic path for messages published to an MQTT broker. - [TopicRetain ]: When set to 'Keep', messages published to an MQTT broker will have the retain flag set. Default: 'Never'. - -EVENT : Array of events that are part of the asset. Each event can have per-event configuration. - Name : The name of the event. - Notifier : The address of the notifier of the event in the asset (e.g. URL) so that a client can access the event on the asset. - [Configuration ]: Stringified JSON that contains connector-specific configuration for the event. For OPC UA, this could include configuration like, publishingInterval, samplingInterval, and queueSize. - [TopicPath ]: The topic path for messages published to an MQTT broker. - [TopicRetain ]: When set to 'Keep', messages published to an MQTT broker will have the retain flag set. Default: 'Never'. - [ObservabilityMode ]: An indication of how the event should be mapped to OpenTelemetry. - INPUTOBJECT : Identity Parameter [AssetEndpointProfileName ]: Asset Endpoint Profile name parameter. [AssetName ]: Asset name parameter. @@ -11604,29 +10852,53 @@ INPUTOBJECT : Identity Parameter [Location ]: The name of the Azure region. [NamespaceName ]: The name of the namespace. [OperationId ]: The ID of an ongoing async operation. - [PolicyName ]: The name of the Policy tracked resource. [ResourceGroupName ]: The name of the resource group. The name is case insensitive. [SchemaName ]: Schema name parameter. [SchemaRegistryName ]: Schema registry name parameter. [SchemaVersionName ]: Schema version name parameter. [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. -.Link -https://learn.microsoft.com/powershell/module/az.deviceregistry/update-azdeviceregistryasset -#> -function Update-AzDeviceRegistryAsset { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAsset])] -[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] -param( - [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] - [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] - [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] - [Alias('AssetName')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Path')] - [System.String] - # Asset name parameter. - ${Name}, - [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] +NAMESPACEINPUTOBJECT : Identity Parameter + [AssetEndpointProfileName ]: Asset Endpoint Profile name parameter. + [AssetName ]: Asset name parameter. + [BillingContainerName ]: Name of the billing container. + [DeviceName ]: The name of the device. + [DiscoveredAssetName ]: The name of the discovered asset. + [DiscoveredDeviceName ]: The name of the discovered device. + [Id ]: Resource identity path + [Location ]: The name of the Azure region. + [NamespaceName ]: The name of the namespace. + [OperationId ]: The ID of an ongoing async operation. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [SchemaName ]: Schema name parameter. + [SchemaRegistryName ]: Schema registry name parameter. + [SchemaVersionName ]: Schema version name parameter. + [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. +.Link +https://learn.microsoft.com/powershell/module/az.deviceregistry/update-azdeviceregistrynamespacedevice +#> +function Update-AzDeviceRegistryNamespaceDevice { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDevice])] +[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaIdentityNamespaceExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Path')] + [System.String] + # The name of the device. + ${DeviceName}, + + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Path')] + [System.String] + # The name of the namespace. + ${NamespaceName}, + + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Path')] @@ -11651,145 +10923,70 @@ param( # Identity Parameter ${InputObject}, + [Parameter(ParameterSetName='UpdateViaIdentityNamespaceExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IDeviceRegistryIdentity] + # Identity Parameter + ${NamespaceInputObject}, + [Parameter(ParameterSetName='UpdateExpanded')] [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityNamespaceExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetUpdatePropertiesAttributes]))] + [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDeviceUpdatePropertiesAttributes]))] [System.Collections.Hashtable] # A set of key-value pairs that contain custom attributes set by the customer. ${Attribute}, [Parameter(ParameterSetName='UpdateExpanded')] [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] - [AllowEmptyCollection()] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IDataset[]] - # Array of datasets that are part of the asset. - # Each dataset describes the data points that make up the set. - ${Dataset}, - - [Parameter(ParameterSetName='UpdateExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] - [System.String] - # Stringified JSON that contains connector-specific default configuration for all datasets. - # Each dataset can have its own configuration that overrides the default settings here. - ${DefaultDatasetsConfiguration}, - - [Parameter(ParameterSetName='UpdateExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] - [System.String] - # Stringified JSON that contains connector-specific default configuration for all events. - # Each event can have its own configuration that overrides the default settings here. - ${DefaultEventsConfiguration}, - - [Parameter(ParameterSetName='UpdateExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] - [System.String] - # The topic path for messages published to an MQTT broker. - ${DefaultTopicPath}, - - [Parameter(ParameterSetName='UpdateExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.PSArgumentCompleterAttribute("Keep", "Never")] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] - [System.String] - # When set to 'Keep', messages published to an MQTT broker will have the retain flag set. - # Default: 'Never'. - ${DefaultTopicRetain}, - - [Parameter(ParameterSetName='UpdateExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] - [System.String] - # Human-readable description of the asset. - ${Description}, - - [Parameter(ParameterSetName='UpdateExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] - [System.String] - # Human-readable display name. - ${DisplayName}, - - [Parameter(ParameterSetName='UpdateExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] - [System.String] - # Reference to the documentation. - ${DocumentationUri}, - - [Parameter(ParameterSetName='UpdateExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityNamespaceExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] [System.Management.Automation.SwitchParameter] - # Enabled/Disabled status of the asset. + # Indicates if the resource and identity are enabled or not. + # A disabled device cannot authenticate with Microsoft Entra ID. ${Enabled}, [Parameter(ParameterSetName='UpdateExpanded')] [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] - [AllowEmptyCollection()] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IEvent[]] - # Array of events that are part of the asset. - # Each event can have per-event configuration. - ${Event}, - - [Parameter(ParameterSetName='UpdateExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] - [System.String] - # Revision number of the hardware. - ${HardwareRevision}, - - [Parameter(ParameterSetName='UpdateExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] - [System.String] - # Asset manufacturer name. - ${Manufacturer}, - - [Parameter(ParameterSetName='UpdateExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] - [System.String] - # Asset manufacturer URI. - ${ManufacturerUri}, - - [Parameter(ParameterSetName='UpdateExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityNamespaceExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] - [System.String] - # Asset model name. - ${Model}, + [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IMessagingEndpointsUpdateInbound]))] + [System.Collections.Hashtable] + # Set of endpoints to connect to the device. + ${EndpointInbound}, [Parameter(ParameterSetName='UpdateExpanded')] [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityNamespaceExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] [System.String] - # Asset product code. - ${ProductCode}, + # Device operating system version. + ${OperatingSystemVersion}, [Parameter(ParameterSetName='UpdateExpanded')] [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityNamespaceExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] - [System.String] - # Asset serial number. - ${SerialNumber}, + [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IOutboundEndpointsUpdateAssigned]))] + [System.Collections.Hashtable] + # Endpoints the device can connect to. + ${OutboundAssigned}, [Parameter(ParameterSetName='UpdateExpanded')] [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityNamespaceExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] - [System.String] - # Revision number of the software. - ${SoftwareRevision}, + [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IOutboundEndpointsUpdateUnassigned]))] + [System.Collections.Hashtable] + # Set of most recently removed endpoints. + ${OutboundUnassigned}, [Parameter(ParameterSetName='UpdateExpanded')] [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityNamespaceExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetUpdateTags]))] + [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDeviceUpdateTags]))] [System.Collections.Hashtable] # Resource tags. ${Tag}, @@ -11902,10 +11099,11 @@ begin { } $mapping = @{ - UpdateExpanded = 'Az.DeviceRegistry.private\Update-AzDeviceRegistryAsset_UpdateExpanded'; - UpdateViaIdentityExpanded = 'Az.DeviceRegistry.private\Update-AzDeviceRegistryAsset_UpdateViaIdentityExpanded'; - UpdateViaJsonFilePath = 'Az.DeviceRegistry.private\Update-AzDeviceRegistryAsset_UpdateViaJsonFilePath'; - UpdateViaJsonString = 'Az.DeviceRegistry.private\Update-AzDeviceRegistryAsset_UpdateViaJsonString'; + UpdateExpanded = 'Az.DeviceRegistry.private\Update-AzDeviceRegistryNamespaceDevice_UpdateExpanded'; + UpdateViaIdentityExpanded = 'Az.DeviceRegistry.private\Update-AzDeviceRegistryNamespaceDevice_UpdateViaIdentityExpanded'; + UpdateViaIdentityNamespaceExpanded = 'Az.DeviceRegistry.private\Update-AzDeviceRegistryNamespaceDevice_UpdateViaIdentityNamespaceExpanded'; + UpdateViaJsonFilePath = 'Az.DeviceRegistry.private\Update-AzDeviceRegistryNamespaceDevice_UpdateViaJsonFilePath'; + UpdateViaJsonString = 'Az.DeviceRegistry.private\Update-AzDeviceRegistryNamespaceDevice_UpdateViaJsonString'; } if (('UpdateExpanded', 'UpdateViaJsonFilePath', 'UpdateViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { @@ -11969,42 +11167,79 @@ end { <# .Synopsis -Update a Credential +Update a NamespaceDiscoveredAsset .Description -Update a Credential +Update a NamespaceDiscoveredAsset +.Example +Update-AzDeviceRegistryNamespaceDiscoveredAsset -ResourceGroupName "my-resource-group" -NamespaceName "my-namespace" -DiscoveredAssetName "my-discovered-asset" -DocumentationUri "https://www.example.com/docs" -SerialNumber "SN123456789" +.Example +$updateJson = '{ + "properties": { + "documentationUri": "https://www.example.com/docs", + "serialNumber": "SN123456789" + } +}' +Update-AzDeviceRegistryNamespaceDiscoveredAsset -ResourceGroupName "my-resource-group" -NamespaceName "my-namespace" -DiscoveredAssetName "my-discovered-asset" -JsonString $updateJson .Example -Update-AzDeviceRegistryCredentials -NamespaceName my-namespace -ResourceGroupName my-resource-group -Tag @{"environment" = "production"; "team" = "iot"; "updated" = "true"} +Update-AzDeviceRegistryNamespaceDiscoveredAsset -ResourceGroupName "my-resource-group" -NamespaceName "my-namespace" -DiscoveredAssetName "my-discovered-asset" -JsonFilePath "C:\path\to\update-discovered-asset.json" .Example -$credentialsIdentity = @{ - SubscriptionId = "xxxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx" +$namespaceIdentity = @{ + SubscriptionId = "00000000-0000-0000-0000-000000000000" ResourceGroupName = "my-resource-group" NamespaceName = "my-namespace" } -Update-AzDeviceRegistryCredentials -InputObject $credentialsIdentity -Tag @{"environment" = "staging"; "team" = "iot"} -.Example -Update-AzDeviceRegistryCredentials -NamespaceName my-namespace -ResourceGroupName my-resource-group -JsonFilePath "C:\credentials\update.json" +Update-AzDeviceRegistryNamespaceDiscoveredAsset -NamespaceInputObject $namespaceIdentity -DiscoveredAssetName "my-discovered-asset" -DocumentationUri "https://www.example.com/docs" -SerialNumber "SN123456789" .Example -$jsonString = @" -{ - "tags": { - "environment": "production", - "team": "iot", - "version": "2.0" - } -} -"@ - -Update-AzDeviceRegistryCredentials -NamespaceName my-namespace -ResourceGroupName my-resource-group -JsonString $jsonString +Update-AzDeviceRegistryNamespaceDiscoveredAsset -InputObject $discoveredAssetObject -DocumentationUri "https://www.example.com/docs" -SerialNumber "SN123456789" .Inputs Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IDeviceRegistryIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICredential +Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDiscoveredAsset .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. +DATASET : Array of datasets that are part of the asset. Each dataset spec describes the data points that make up the set. + Name : Name of the dataset. + [DataPoint >]: Array of data points that are part of the dataset. Each data point can have per-data point configuration. + DataSource : The address of the source of the data in the asset (e.g. URL) so that a client can access the data source on the asset. + Name : The name of the data point. + [DataPointConfiguration ]: Stringified JSON that contains connector-specific configuration for the data point. For OPC UA, this could include configuration like, publishingInterval, samplingInterval, and queueSize. + [LastUpdatedOn ]: UTC timestamp indicating when the data point was added or modified. + [TypeRef ]: URI or type definition ID. + [DataSource ]: Reference to a data source for a given dataset. + [DatasetConfiguration ]: Stringified JSON that contains connector-specific properties that describes configuration for the specific dataset. + [Destination >]: Destinations for a dataset. + Target : Target destination. + [LastUpdatedOn ]: Timestamp (in UTC) indicating when the dataset was added or modified. + [TypeRef ]: URI or type definition ID. + +DEFAULTDATASETSDESTINATION : Default destinations for a dataset. + Target : Target destination. + +DEFAULTEVENTSDESTINATION : Default destinations for an event. + Target : Target destination. + +DEFAULTSTREAMSDESTINATION : Default destinations for a stream. + Target : Target destination. + +EVENTGROUP : Array of event groups that are part of the asset. Each event group can have per-event group configuration. + Name : The name of the event group. + [DataSource ]: The address of the notifier of the event group in the asset (e.g. URL) so that a client can access the event group on the asset. + [DefaultDestination >]: Destinations for events. Default destinations when destinations is not defined at the event level. + Target : Target destination. + [Event >]: Array of events that are part of the event group. + Name : The name of the event. + [DataSource ]: Reference to a data source for a given event. + [Destination >]: Destinations for an event. + [EventConfiguration ]: Stringified JSON that contains connector-specific configuration for the event. For OPC UA, this could include configuration like, publishingInterval, samplingInterval, and queueSize. + [LastUpdatedOn ]: UTC timestamp indicating when the event was added or modified. + [TypeRef ]: URI or type definition ID. + [EventGroupConfiguration ]: Stringified JSON that contains connector-specific configuration for the event group. For OPC UA, this could include configuration like, publishingInterval, samplingInterval, and queueSize. + [TypeRef ]: URI or type definition ID. + INPUTOBJECT : Identity Parameter [AssetEndpointProfileName ]: Asset Endpoint Profile name parameter. [AssetName ]: Asset name parameter. @@ -12016,22 +11251,73 @@ INPUTOBJECT : Identity Parameter [Location ]: The name of the Azure region. [NamespaceName ]: The name of the namespace. [OperationId ]: The ID of an ongoing async operation. - [PolicyName ]: The name of the Policy tracked resource. [ResourceGroupName ]: The name of the resource group. The name is case insensitive. [SchemaName ]: Schema name parameter. [SchemaRegistryName ]: Schema registry name parameter. [SchemaVersionName ]: Schema version name parameter. [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. -.Link -https://learn.microsoft.com/powershell/module/az.deviceregistry/update-azdeviceregistrycredentials -#> -function Update-AzDeviceRegistryCredentials { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICredential])] -[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] -param( - [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] - [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] - [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] + +MANAGEMENTGROUP : Array of management groups that are part of the asset. Each management group can have a per-group configuration. + Name : Name of the management group. + [Action >]: Array of actions that are part of the management group. Each action can have an individual configuration. + Name : Name of the action. + TargetUri : The target URI on which a client can invoke the specific action. + [ActionConfiguration ]: Stringified JSON that contains connector-specific configuration for the action. + [ActionType ]: The type of the action. + [LastUpdatedOn ]: Timestamp (in UTC) indicating when the management action was added or modified. + [TimeoutInSecond ]: Response timeout for the action. + [Topic ]: The MQTT topic path on which a client will receive the request for the action. + [TypeRef ]: URI or type definition ID. + [DataSource ]: Reference to a data source for a given management group. + [DefaultTimeoutInSecond ]: Default response timeout for all actions that are part of the management group. + [DefaultTopic ]: Default MQTT topic path on which a client will receive the request for all actions that are part of the management group. + [LastUpdatedOn ]: Timestamp (in UTC) indicating when the management group was added or modified. + [ManagementGroupConfiguration ]: Stringified JSON that contains connector-specific configuration for the management group. + [TypeRef ]: URI or type definition ID. + +NAMESPACEINPUTOBJECT : Identity Parameter + [AssetEndpointProfileName ]: Asset Endpoint Profile name parameter. + [AssetName ]: Asset name parameter. + [BillingContainerName ]: Name of the billing container. + [DeviceName ]: The name of the device. + [DiscoveredAssetName ]: The name of the discovered asset. + [DiscoveredDeviceName ]: The name of the discovered device. + [Id ]: Resource identity path + [Location ]: The name of the Azure region. + [NamespaceName ]: The name of the namespace. + [OperationId ]: The ID of an ongoing async operation. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [SchemaName ]: Schema name parameter. + [SchemaRegistryName ]: Schema registry name parameter. + [SchemaVersionName ]: Schema version name parameter. + [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. + +STREAM : Array of streams that are part of the asset. Each stream can have a per-stream configuration. + Name : Name of the stream definition. + [Destination >]: Destinations for a stream. + Target : Target destination. + [LastUpdatedOn ]: Timestamp (in UTC) indicating when the stream was added or modified. + [StreamConfiguration ]: Stringified JSON that contains connector-specific configuration for the specific stream. + [TypeRef ]: URI or type definition ID. +.Link +https://learn.microsoft.com/powershell/module/az.deviceregistry/update-azdeviceregistrynamespacediscoveredasset +#> +function Update-AzDeviceRegistryNamespaceDiscoveredAsset { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDiscoveredAsset])] +[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaIdentityNamespaceExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Path')] + [System.String] + # The name of the discovered asset. + ${DiscoveredAssetName}, + + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Path')] [System.String] # The name of the namespace. @@ -12062,2073 +11348,242 @@ param( # Identity Parameter ${InputObject}, + [Parameter(ParameterSetName='UpdateViaIdentityNamespaceExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IDeviceRegistryIdentity] + # Identity Parameter + ${NamespaceInputObject}, + + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityNamespaceExpanded')] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] + [System.String[]] + # URIs or type definition IDs. + ${AssetTypeRef}, + [Parameter(ParameterSetName='UpdateExpanded')] [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityNamespaceExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICredentialUpdateTags]))] + [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDiscoveredAssetUpdatePropertiesAttributes]))] [System.Collections.Hashtable] - # Resource tags. - ${Tag}, + # A set of key-value pairs that contain custom attributes. + ${Attribute}, - [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityNamespaceExpanded')] + [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] - [System.String] - # Path of Json file supplied to the Update operation - ${JsonFilePath}, + [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDiscoveredDataset[]] + # Array of datasets that are part of the asset. + # Each dataset spec describes the data points that make up the set. + ${Dataset}, - [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityNamespaceExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] [System.String] - # Json string supplied to the Update operation - ${JsonString}, - - [Parameter()] - [Alias('AzureRMContext', 'AzureCredential')] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category('Runtime')] - [System.Management.Automation.SwitchParameter] - # Run the command as a job - ${AsJob}, - - [Parameter(DontShow)] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Runtime')] - [System.Management.Automation.SwitchParameter] - # Wait for .NET debugger to attach - ${Break}, - - [Parameter(DontShow)] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Runtime')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SendAsyncStep[]] - # SendAsync Pipeline Steps to be appended to the front of the pipeline - ${HttpPipelineAppend}, - - [Parameter(DontShow)] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Runtime')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SendAsyncStep[]] - # SendAsync Pipeline Steps to be prepended to the front of the pipeline - ${HttpPipelinePrepend}, + # Stringified JSON that contains connector-specific default configuration for all datasets. + # Each dataset can have its own configuration that overrides the default settings here. + ${DefaultDatasetsConfiguration}, - [Parameter()] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Runtime')] - [System.Management.Automation.SwitchParameter] - # Run the command asynchronously - ${NoWait}, + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityNamespaceExpanded')] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IDatasetDestination[]] + # Default destinations for a dataset. + ${DefaultDatasetsDestination}, - [Parameter(DontShow)] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Runtime')] - [System.Uri] - # The URI for the proxy server to use - ${Proxy}, + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityNamespaceExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] + [System.String] + # Stringified JSON that contains connector-specific default configuration for all events. + # Each event can have its own configuration that overrides the default settings here. + ${DefaultEventsConfiguration}, - [Parameter(DontShow)] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Runtime')] - [System.Management.Automation.PSCredential] - # Credentials for a proxy server to use for the remote call - ${ProxyCredential}, + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityNamespaceExpanded')] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IEventDestination[]] + # Default destinations for an event. + ${DefaultEventsDestination}, - [Parameter(DontShow)] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Runtime')] - [System.Management.Automation.SwitchParameter] - # Use the default credentials for the proxy - ${ProxyUseDefaultCredentials} -) + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityNamespaceExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] + [System.String] + # Stringified JSON that contains connector-specific default configuration for all management groups. + # Each management group can have its own configuration that overrides the default settings here. + ${DefaultManagementGroupsConfiguration}, -begin { - try { - $outBuffer = $null - if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { - $PSBoundParameters['OutBuffer'] = 1 - } - $parameterSet = $PSCmdlet.ParameterSetName - - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityNamespaceExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] + [System.String] + # Stringified JSON that contains connector-specific default configuration for all streams. + # Each stream can have its own configuration that overrides the default settings here. + ${DefaultStreamsConfiguration}, - $context = Get-AzContext - if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit - } + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityNamespaceExpanded')] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IStreamDestination[]] + # Default destinations for a stream. + ${DefaultStreamsDestination}, - 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.DeviceRegistry.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 = @{ - UpdateExpanded = 'Az.DeviceRegistry.private\Update-AzDeviceRegistryCredentials_UpdateExpanded'; - UpdateViaIdentityExpanded = 'Az.DeviceRegistry.private\Update-AzDeviceRegistryCredentials_UpdateViaIdentityExpanded'; - UpdateViaJsonFilePath = 'Az.DeviceRegistry.private\Update-AzDeviceRegistryCredentials_UpdateViaJsonFilePath'; - UpdateViaJsonString = 'Az.DeviceRegistry.private\Update-AzDeviceRegistryCredentials_UpdateViaJsonString'; - } - if (('UpdateExpanded', 'UpdateViaJsonFilePath', 'UpdateViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { - 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.DeviceRegistry.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.DeviceRegistry.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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) - if ($wrappedCmd -eq $null) { - $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) - } - $scriptCmd = {& $wrappedCmd @PSBoundParameters} - $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) - $steppablePipeline.Begin($PSCmdlet) - } 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.DeviceRegistry.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 -Update a NamespaceAsset -.Description -Update a NamespaceAsset -.Example -Update-AzDeviceRegistryNamespaceAsset -ResourceGroupName "my-resource-group" -NamespaceName "my-namespace" -AssetName "my-asset" -DocumentationUri "https://www.example.com/docs" -DisplayName "My Updated Asset" -.Example -$updateJson = '{ - "properties": { - "documentationUri": "https://www.example.com/docs", - "displayName": "My Updated Asset" - } -}' -Update-AzDeviceRegistryNamespaceAsset -ResourceGroupName "my-resource-group" -NamespaceName "my-namespace" -AssetName "my-asset" -JsonString $updateJson -.Example -Update-AzDeviceRegistryNamespaceAsset -ResourceGroupName "my-resource-group" -NamespaceName "my-namespace" -AssetName "my-asset" -JsonFilePath "C:\path\to\update-asset.json" -.Example -$namespaceIdentity = @{ - SubscriptionId = "00000000-0000-0000-0000-000000000000" - ResourceGroupName = "my-resource-group" - NamespaceName = "my-namespace" -} -Update-AzDeviceRegistryNamespaceAsset -NamespaceInputObject $namespaceIdentity -AssetName "my-asset" -DocumentationUri "https://www.example.com/docs" -DisplayName "My Updated Asset" -.Example -Update-AzDeviceRegistryNamespaceAsset -InputObject $assetObject -DocumentationUri "https://www.example.com/docs" -DisplayName "My Updated Asset" - -.Inputs -Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IDeviceRegistryIdentity -.Outputs -Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceAsset -.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. - -DATASET : Array of datasets that are part of the asset. Each dataset describes the data points that make up the set. - Name : Name of the dataset. - [DataPoint >]: Array of data points that are part of the dataset. Each data point can have per-data point configuration. - DataSource : The address of the source of the data in the asset (e.g. URL) so that a client can access the data source on the asset. - Name : The name of the data point. - [DataPointConfiguration ]: Stringified JSON that contains connector-specific configuration for the data point. For OPC UA, this could include configuration like, publishingInterval, samplingInterval, and queueSize. - [TypeRef ]: URI or type definition ID. - [DataSource ]: Reference to a data source for a given dataset. - [DatasetConfiguration ]: Stringified JSON that contains connector-specific JSON string that describes configuration for the specific dataset. - [Destination >]: Destinations for a dataset. - Target : Target destination. - [TypeRef ]: URI or type definition ID. - -DEFAULTDATASETSDESTINATION : Default destinations for a dataset. - Target : Target destination. - -DEFAULTEVENTSDESTINATION : Default destinations for an event. - Target : Target destination. - -DEFAULTSTREAMSDESTINATION : Default destinations for a stream. - Target : Target destination. - -EVENTGROUP : Array of event groups that are part of the asset. Each event group can have per-event group configuration. - Name : The name of the event group. - [DataSource ]: The address of the notifier of the event group in the asset (e.g. URL) so that a client can access the event group on the asset. - [DefaultDestination >]: Destinations for events. Default destinations when destinations is not defined at the event level. - Target : Target destination. - [Event >]: Array of events that are part of the event group. - Name : The name of the event. - [DataSource ]: Reference to a data source for a given event. - [Destination >]: Destinations for an event. - [EventConfiguration ]: Stringified JSON that contains connector-specific configuration for the event. For OPC UA, this could include configuration like, publishingInterval, samplingInterval, and queueSize. - [TypeRef ]: URI or type definition ID. - [EventGroupConfiguration ]: Stringified JSON that contains connector-specific configuration for the event group. For OPC UA, this could include configuration like, publishingInterval, samplingInterval, and queueSize. - [TypeRef ]: URI or type definition ID. - -INPUTOBJECT : Identity Parameter - [AssetEndpointProfileName ]: Asset Endpoint Profile name parameter. - [AssetName ]: Asset name parameter. - [BillingContainerName ]: Name of the billing container. - [DeviceName ]: The name of the device. - [DiscoveredAssetName ]: The name of the discovered asset. - [DiscoveredDeviceName ]: The name of the discovered device. - [Id ]: Resource identity path - [Location ]: The name of the Azure region. - [NamespaceName ]: The name of the namespace. - [OperationId ]: The ID of an ongoing async operation. - [PolicyName ]: The name of the Policy tracked resource. - [ResourceGroupName ]: The name of the resource group. The name is case insensitive. - [SchemaName ]: Schema name parameter. - [SchemaRegistryName ]: Schema registry name parameter. - [SchemaVersionName ]: Schema version name parameter. - [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. - -MANAGEMENTGROUP : Array of management groups that are part of the asset. Each management group can have a per-group configuration. - Name : Name of the management group. - [Action >]: Array of actions that are part of the management group. Each action can have an individual configuration. - Name : Name of the action. - TargetUri : The target URI on which a client can invoke the specific action. - [ActionConfiguration ]: Stringified JSON that contains connector-specific configuration for the action. - [ActionType ]: The type of the action. - [TimeoutInSecond ]: Response timeout for the action. - [Topic ]: The MQTT topic path on which a client will receive the request for the action. - [TypeRef ]: URI or type definition ID. - [Configuration ]: Stringified JSON that contains connector-specific configuration for the management group. - [DataSource ]: Reference to a data source for a given management group. - [DefaultTimeoutInSecond ]: Default response timeout for all actions that are part of the management group. - [DefaultTopic ]: Default MQTT topic path on which a client will receive the request for all actions that are part of the management group. - [TypeRef ]: URI or type definition ID. - -NAMESPACEINPUTOBJECT : Identity Parameter - [AssetEndpointProfileName ]: Asset Endpoint Profile name parameter. - [AssetName ]: Asset name parameter. - [BillingContainerName ]: Name of the billing container. - [DeviceName ]: The name of the device. - [DiscoveredAssetName ]: The name of the discovered asset. - [DiscoveredDeviceName ]: The name of the discovered device. - [Id ]: Resource identity path - [Location ]: The name of the Azure region. - [NamespaceName ]: The name of the namespace. - [OperationId ]: The ID of an ongoing async operation. - [PolicyName ]: The name of the Policy tracked resource. - [ResourceGroupName ]: The name of the resource group. The name is case insensitive. - [SchemaName ]: Schema name parameter. - [SchemaRegistryName ]: Schema registry name parameter. - [SchemaVersionName ]: Schema version name parameter. - [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. - -STREAM : Array of streams that are part of the asset. Each stream can have a per-stream configuration. - Name : Name of the stream definition. - [Destination >]: Destinations for a stream. - Target : Target destination. - [StreamConfiguration ]: Stringified JSON that contains connector-specific configuration for the specific stream. - [TypeRef ]: URI or type definition ID. -.Link -https://learn.microsoft.com/powershell/module/az.deviceregistry/update-azdeviceregistrynamespaceasset -#> -function Update-AzDeviceRegistryNamespaceAsset { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceAsset])] -[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] -param( - [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] - [Parameter(ParameterSetName='UpdateViaIdentityNamespaceExpanded', Mandatory)] - [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] - [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Path')] - [System.String] - # The name of the asset. - ${AssetName}, - - [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] - [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] - [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Path')] - [System.String] - # The name of the namespace. - ${NamespaceName}, - - [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] - [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] - [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Path')] - [System.String] - # The name of the resource group. - # The name is case insensitive. - ${ResourceGroupName}, - - [Parameter(ParameterSetName='UpdateExpanded')] - [Parameter(ParameterSetName='UpdateViaJsonFilePath')] - [Parameter(ParameterSetName='UpdateViaJsonString')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Path')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] - [System.String] - # The ID of the target subscription. - # The value must be an UUID. - ${SubscriptionId}, - - [Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory, ValueFromPipeline)] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Path')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IDeviceRegistryIdentity] - # Identity Parameter - ${InputObject}, - - [Parameter(ParameterSetName='UpdateViaIdentityNamespaceExpanded', Mandatory, ValueFromPipeline)] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Path')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IDeviceRegistryIdentity] - # Identity Parameter - ${NamespaceInputObject}, - - [Parameter(ParameterSetName='UpdateExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityNamespaceExpanded')] - [AllowEmptyCollection()] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] - [System.String[]] - # URIs or type definition IDs. - ${AssetTypeRef}, - - [Parameter(ParameterSetName='UpdateExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityNamespaceExpanded')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceAssetUpdatePropertiesAttributes]))] - [System.Collections.Hashtable] - # A set of key-value pairs that contain custom attributes set by the customer. - ${Attribute}, + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityNamespaceExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] + [System.String] + # Human-readable description of the asset. + ${Description}, [Parameter(ParameterSetName='UpdateExpanded')] [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Parameter(ParameterSetName='UpdateViaIdentityNamespaceExpanded')] - [AllowEmptyCollection()] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDataset[]] - # Array of datasets that are part of the asset. - # Each dataset describes the data points that make up the set. - ${Dataset}, - - [Parameter(ParameterSetName='UpdateExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityNamespaceExpanded')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] - [System.String] - # Stringified JSON that contains connector-specific default configuration for all datasets. - # Each dataset can have its own configuration that overrides the default settings here. - ${DefaultDatasetsConfiguration}, - - [Parameter(ParameterSetName='UpdateExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityNamespaceExpanded')] - [AllowEmptyCollection()] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IDatasetDestination[]] - # Default destinations for a dataset. - ${DefaultDatasetsDestination}, - - [Parameter(ParameterSetName='UpdateExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityNamespaceExpanded')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] - [System.String] - # Stringified JSON that contains connector-specific default configuration for all events. - # Each event can have its own configuration that overrides the default settings here. - ${DefaultEventsConfiguration}, - - [Parameter(ParameterSetName='UpdateExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityNamespaceExpanded')] - [AllowEmptyCollection()] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IEventDestination[]] - # Default destinations for an event. - ${DefaultEventsDestination}, - - [Parameter(ParameterSetName='UpdateExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityNamespaceExpanded')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] - [System.String] - # Stringified JSON that contains connector-specific default configuration for all management groups. - # Each management group can have its own configuration that overrides the default settings here. - ${DefaultManagementGroupsConfiguration}, - - [Parameter(ParameterSetName='UpdateExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityNamespaceExpanded')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] - [System.String] - # Stringified JSON that contains connector-specific default configuration for all streams. - # Each stream can have its own configuration that overrides the default settings here. - ${DefaultStreamsConfiguration}, - - [Parameter(ParameterSetName='UpdateExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityNamespaceExpanded')] - [AllowEmptyCollection()] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IStreamDestination[]] - # Default destinations for a stream. - ${DefaultStreamsDestination}, - - [Parameter(ParameterSetName='UpdateExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityNamespaceExpanded')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] - [System.String] - # Human-readable description of the asset. - ${Description}, - - [Parameter(ParameterSetName='UpdateExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityNamespaceExpanded')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] - [System.String] - # Human-readable display name. - ${DisplayName}, - - [Parameter(ParameterSetName='UpdateExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityNamespaceExpanded')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] - [System.String] - # Asset documentation reference. - ${DocumentationUri}, - - [Parameter(ParameterSetName='UpdateExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityNamespaceExpanded')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] - [System.Management.Automation.SwitchParameter] - # Enabled/disabled status of the asset. - ${Enabled}, - - [Parameter(ParameterSetName='UpdateExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityNamespaceExpanded')] - [AllowEmptyCollection()] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceEventGroup[]] - # Array of event groups that are part of the asset. - # Each event group can have per-event group configuration. - ${EventGroup}, - - [Parameter(ParameterSetName='UpdateExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityNamespaceExpanded')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] - [System.String] - # Asset hardware revision number. - ${HardwareRevision}, - - [Parameter(ParameterSetName='UpdateExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityNamespaceExpanded')] - [AllowEmptyCollection()] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IManagementGroup[]] - # Array of management groups that are part of the asset. - # Each management group can have a per-group configuration. - ${ManagementGroup}, - - [Parameter(ParameterSetName='UpdateExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityNamespaceExpanded')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] - [System.String] - # Asset manufacturer. - ${Manufacturer}, - - [Parameter(ParameterSetName='UpdateExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityNamespaceExpanded')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] - [System.String] - # Asset manufacturer URI. - ${ManufacturerUri}, - - [Parameter(ParameterSetName='UpdateExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityNamespaceExpanded')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] - [System.String] - # Asset model. - ${Model}, - - [Parameter(ParameterSetName='UpdateExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityNamespaceExpanded')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] - [System.String] - # Asset product code. - ${ProductCode}, - - [Parameter(ParameterSetName='UpdateExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityNamespaceExpanded')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] - [System.String] - # Asset serial number. - ${SerialNumber}, - - [Parameter(ParameterSetName='UpdateExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityNamespaceExpanded')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] - [System.String] - # Asset software revision number. - ${SoftwareRevision}, - - [Parameter(ParameterSetName='UpdateExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityNamespaceExpanded')] - [AllowEmptyCollection()] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceStream[]] - # Array of streams that are part of the asset. - # Each stream can have a per-stream configuration. - ${Stream}, - - [Parameter(ParameterSetName='UpdateExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityNamespaceExpanded')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceAssetUpdateTags]))] - [System.Collections.Hashtable] - # Resource tags. - ${Tag}, - - [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] - [System.String] - # Path of Json file supplied to the Update operation - ${JsonFilePath}, - - [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] - [System.String] - # Json string supplied to the Update operation - ${JsonString}, - - [Parameter()] - [Alias('AzureRMContext', 'AzureCredential')] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category('Runtime')] - [System.Management.Automation.SwitchParameter] - # Run the command as a job - ${AsJob}, - - [Parameter(DontShow)] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Runtime')] - [System.Management.Automation.SwitchParameter] - # Wait for .NET debugger to attach - ${Break}, - - [Parameter(DontShow)] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Runtime')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SendAsyncStep[]] - # SendAsync Pipeline Steps to be appended to the front of the pipeline - ${HttpPipelineAppend}, - - [Parameter(DontShow)] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Runtime')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SendAsyncStep[]] - # SendAsync Pipeline Steps to be prepended to the front of the pipeline - ${HttpPipelinePrepend}, - - [Parameter()] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Runtime')] - [System.Management.Automation.SwitchParameter] - # Run the command asynchronously - ${NoWait}, - - [Parameter(DontShow)] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Runtime')] - [System.Uri] - # The URI for the proxy server to use - ${Proxy}, - - [Parameter(DontShow)] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Runtime')] - [System.Management.Automation.PSCredential] - # Credentials for a proxy server to use for the remote call - ${ProxyCredential}, - - [Parameter(DontShow)] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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 - - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } - - $context = Get-AzContext - if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit - } - - if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() - } - $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId - if ($preTelemetryId -eq '') { - [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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 = @{ - UpdateExpanded = 'Az.DeviceRegistry.private\Update-AzDeviceRegistryNamespaceAsset_UpdateExpanded'; - UpdateViaIdentityExpanded = 'Az.DeviceRegistry.private\Update-AzDeviceRegistryNamespaceAsset_UpdateViaIdentityExpanded'; - UpdateViaIdentityNamespaceExpanded = 'Az.DeviceRegistry.private\Update-AzDeviceRegistryNamespaceAsset_UpdateViaIdentityNamespaceExpanded'; - UpdateViaJsonFilePath = 'Az.DeviceRegistry.private\Update-AzDeviceRegistryNamespaceAsset_UpdateViaJsonFilePath'; - UpdateViaJsonString = 'Az.DeviceRegistry.private\Update-AzDeviceRegistryNamespaceAsset_UpdateViaJsonString'; - } - if (('UpdateExpanded', 'UpdateViaJsonFilePath', 'UpdateViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { - 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.DeviceRegistry.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.DeviceRegistry.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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) - if ($wrappedCmd -eq $null) { - $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) - } - $scriptCmd = {& $wrappedCmd @PSBoundParameters} - $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) - $steppablePipeline.Begin($PSCmdlet) - } 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.DeviceRegistry.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 -Update a NamespaceDevice -.Description -Update a NamespaceDevice -.Example -$endpointsInbound = @{ - "endpoint1" = @{ - Address = "https://my-inbound-endpoint1.westeurope-1.iothub.azure.net" - EndpointType = "Microsoft.Devices/IotHubs" - AuthenticationMethod = "Certificate" - X509CredentialsCertificateSecretName = "my-certificate" - } - "endpoint2" = @{ - Address = "https://myendpoint2.westeurope-1.iothub.azure.net" - EndpointType = "Microsoft.Devices/IotHubs" - AuthenticationMethod = "UsernamePassword" - UsernamePasswordCredentialsUsernameSecretName = "my-username-secret" - UsernamePasswordCredentialsPasswordSecretName = "my-password-secret" - } -} -Update-AzDeviceRegistryNamespaceDevice -ResourceGroupName "my-resource-group" -NamespaceName "my-namespace" -DeviceName "my-device" -OperatingSystemVersion "10.0.19041" -EndpointInbound $endpointsInbound -.Example -$updateJson = '{ - "properties": { - "operatingSystemVersion": "10.0.19041", - "endpointsInbound": { - "endpoint1": { - "address": "https://my-inbound-endpoint1.westeurope-1.iothub.azure.net", - "endpointType": "Microsoft.Devices/IotHubs", - "authentication": { - "method": "Certificate", - "x509Credentials": { - "certificateSecretName": "my-certificate" - } - } - }, - "endpoint2": { - "address": "https://my-inbound-endpoint2.westeurope-1.iothub.azure.net", - "endpointType": "Microsoft.Devices/IotHubs", - "authentication": { - "method": "UsernamePassword", - "usernamePasswordCredentials": { - "usernameSecretName": "my-username-secret", - "passwordSecretName": "my-password-secret" - } - } - } - } - } -}' -Update-AzDeviceRegistryNamespaceDevice -ResourceGroupName "my-resource-group" -NamespaceName "my-namespace" -DeviceName "my-device" -JsonString $updateJson -.Example -Update-AzDeviceRegistryNamespaceDevice -ResourceGroupName "my-resource-group" -NamespaceName "my-namespace" -DeviceName "my-device" -JsonFilePath "C:\path\to\update-device.json" -.Example -$namespaceIdentity = @{ - SubscriptionId = "00000000-0000-0000-0000-000000000000" - ResourceGroupName = "my-resource-group" - NamespaceName = "my-namespace" -} -$endpointsInbound = @{ - "endpoint1" = @{ - Address = "https://my-inbound-endpoint1.westeurope-1.iothub.azure.net" - EndpointType = "Microsoft.Devices/IotHubs" - AuthenticationMethod = "Certificate" - X509CredentialsCertificateSecretName = "my-certificate" - } - "endpoint2" = @{ - Address = "https://myendpoint2.westeurope-1.iothub.azure.net" - EndpointType = "Microsoft.Devices/IotHubs" - AuthenticationMethod = "UsernamePassword" - UsernamePasswordCredentialsUsernameSecretName = "my-username-secret" - UsernamePasswordCredentialsPasswordSecretName = "my-password-secret" - } -} -Update-AzDeviceRegistryNamespaceDevice -NamespaceInputObject $namespaceIdentity -DeviceName "my-device" -OperatingSystemVersion "10.0.19041" -EndpointInbound $endpointsInbound -.Example -# Define the device identifiers -$SubscriptionId = (Get-AzContext).Subscription.Id -$ResourceGroupName = "my-resource-group" -$NamespaceName = "my-namespace" -$DeviceName = "my-device" - -# Create a device identity object -$deviceIdentity = @{ - SubscriptionId = $SubscriptionId - ResourceGroupName = $ResourceGroupName - NamespaceName = $NamespaceName - DeviceName = $DeviceName -} - -$endpointsInbound = @{ - "endpoint1" = @{ - Address = "https://my-inbound-endpoint1.westeurope-1.iothub.azure.net" - EndpointType = "Microsoft.Devices/IotHubs" - AuthenticationMethod = "Certificate" - X509CredentialsCertificateSecretName = "my-certificate" - } - "endpoint2" = @{ - Address = "https://myendpoint2.westeurope-1.iothub.azure.net" - EndpointType = "Microsoft.Devices/IotHubs" - AuthenticationMethod = "UsernamePassword" - UsernamePasswordCredentialsUsernameSecretName = "my-username-secret" - UsernamePasswordCredentialsPasswordSecretName = "my-password-secret" - } -} - -Update-AzDeviceRegistryNamespaceDevice -InputObject $deviceIdentity -OperatingSystemVersion "10.0.19041" -EndpointInbound $endpointsInbound - -.Inputs -Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IDeviceRegistryIdentity -.Outputs -Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDevice -.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 - [AssetEndpointProfileName ]: Asset Endpoint Profile name parameter. - [AssetName ]: Asset name parameter. - [BillingContainerName ]: Name of the billing container. - [DeviceName ]: The name of the device. - [DiscoveredAssetName ]: The name of the discovered asset. - [DiscoveredDeviceName ]: The name of the discovered device. - [Id ]: Resource identity path - [Location ]: The name of the Azure region. - [NamespaceName ]: The name of the namespace. - [OperationId ]: The ID of an ongoing async operation. - [PolicyName ]: The name of the Policy tracked resource. - [ResourceGroupName ]: The name of the resource group. The name is case insensitive. - [SchemaName ]: Schema name parameter. - [SchemaRegistryName ]: Schema registry name parameter. - [SchemaVersionName ]: Schema version name parameter. - [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. - -NAMESPACEINPUTOBJECT : Identity Parameter - [AssetEndpointProfileName ]: Asset Endpoint Profile name parameter. - [AssetName ]: Asset name parameter. - [BillingContainerName ]: Name of the billing container. - [DeviceName ]: The name of the device. - [DiscoveredAssetName ]: The name of the discovered asset. - [DiscoveredDeviceName ]: The name of the discovered device. - [Id ]: Resource identity path - [Location ]: The name of the Azure region. - [NamespaceName ]: The name of the namespace. - [OperationId ]: The ID of an ongoing async operation. - [PolicyName ]: The name of the Policy tracked resource. - [ResourceGroupName ]: The name of the resource group. The name is case insensitive. - [SchemaName ]: Schema name parameter. - [SchemaRegistryName ]: Schema registry name parameter. - [SchemaVersionName ]: Schema version name parameter. - [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. -.Link -https://learn.microsoft.com/powershell/module/az.deviceregistry/update-azdeviceregistrynamespacedevice -#> -function Update-AzDeviceRegistryNamespaceDevice { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDevice])] -[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] -param( - [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] - [Parameter(ParameterSetName='UpdateViaIdentityNamespaceExpanded', Mandatory)] - [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] - [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Path')] - [System.String] - # The name of the device. - ${DeviceName}, - - [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] - [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] - [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Path')] - [System.String] - # The name of the namespace. - ${NamespaceName}, - - [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] - [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] - [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Path')] - [System.String] - # The name of the resource group. - # The name is case insensitive. - ${ResourceGroupName}, - - [Parameter(ParameterSetName='UpdateExpanded')] - [Parameter(ParameterSetName='UpdateViaJsonFilePath')] - [Parameter(ParameterSetName='UpdateViaJsonString')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Path')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] - [System.String] - # The ID of the target subscription. - # The value must be an UUID. - ${SubscriptionId}, - - [Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory, ValueFromPipeline)] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Path')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IDeviceRegistryIdentity] - # Identity Parameter - ${InputObject}, - - [Parameter(ParameterSetName='UpdateViaIdentityNamespaceExpanded', Mandatory, ValueFromPipeline)] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Path')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IDeviceRegistryIdentity] - # Identity Parameter - ${NamespaceInputObject}, - - [Parameter(ParameterSetName='UpdateExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityNamespaceExpanded')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDeviceUpdatePropertiesAttributes]))] - [System.Collections.Hashtable] - # A set of key-value pairs that contain custom attributes set by the customer. - ${Attribute}, - - [Parameter(ParameterSetName='UpdateExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityNamespaceExpanded')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] - [System.Management.Automation.SwitchParameter] - # Indicates if the resource and identity are enabled or not. - # A disabled device cannot authenticate with Microsoft Entra ID. - ${Enabled}, - - [Parameter(ParameterSetName='UpdateExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityNamespaceExpanded')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IMessagingEndpointsUpdateInbound]))] - [System.Collections.Hashtable] - # Set of endpoints to connect to the device. - ${EndpointInbound}, - - [Parameter(ParameterSetName='UpdateExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityNamespaceExpanded')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] - [System.String] - # Device operating system version. - ${OperatingSystemVersion}, - - [Parameter(ParameterSetName='UpdateExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityNamespaceExpanded')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IOutboundEndpointsUpdateAssigned]))] - [System.Collections.Hashtable] - # Endpoints the device can connect to. - ${OutboundAssigned}, - - [Parameter(ParameterSetName='UpdateExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityNamespaceExpanded')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IOutboundEndpointsUpdateUnassigned]))] - [System.Collections.Hashtable] - # Set of most recently removed endpoints. - ${OutboundUnassigned}, - - [Parameter(ParameterSetName='UpdateExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityNamespaceExpanded')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] - [System.String] - # Resource Id of the Policy. - ${PolicyResourceId}, - - [Parameter(ParameterSetName='UpdateExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityNamespaceExpanded')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDeviceUpdateTags]))] - [System.Collections.Hashtable] - # Resource tags. - ${Tag}, - - [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] - [System.String] - # Path of Json file supplied to the Update operation - ${JsonFilePath}, - - [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] - [System.String] - # Json string supplied to the Update operation - ${JsonString}, - - [Parameter()] - [Alias('AzureRMContext', 'AzureCredential')] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category('Runtime')] - [System.Management.Automation.SwitchParameter] - # Run the command as a job - ${AsJob}, - - [Parameter(DontShow)] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Runtime')] - [System.Management.Automation.SwitchParameter] - # Wait for .NET debugger to attach - ${Break}, - - [Parameter(DontShow)] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Runtime')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SendAsyncStep[]] - # SendAsync Pipeline Steps to be appended to the front of the pipeline - ${HttpPipelineAppend}, - - [Parameter(DontShow)] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Runtime')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SendAsyncStep[]] - # SendAsync Pipeline Steps to be prepended to the front of the pipeline - ${HttpPipelinePrepend}, - - [Parameter()] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Runtime')] - [System.Management.Automation.SwitchParameter] - # Run the command asynchronously - ${NoWait}, - - [Parameter(DontShow)] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Runtime')] - [System.Uri] - # The URI for the proxy server to use - ${Proxy}, - - [Parameter(DontShow)] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Runtime')] - [System.Management.Automation.PSCredential] - # Credentials for a proxy server to use for the remote call - ${ProxyCredential}, - - [Parameter(DontShow)] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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 - - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } - - $context = Get-AzContext - if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit - } - - if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() - } - $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId - if ($preTelemetryId -eq '') { - [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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 = @{ - UpdateExpanded = 'Az.DeviceRegistry.private\Update-AzDeviceRegistryNamespaceDevice_UpdateExpanded'; - UpdateViaIdentityExpanded = 'Az.DeviceRegistry.private\Update-AzDeviceRegistryNamespaceDevice_UpdateViaIdentityExpanded'; - UpdateViaIdentityNamespaceExpanded = 'Az.DeviceRegistry.private\Update-AzDeviceRegistryNamespaceDevice_UpdateViaIdentityNamespaceExpanded'; - UpdateViaJsonFilePath = 'Az.DeviceRegistry.private\Update-AzDeviceRegistryNamespaceDevice_UpdateViaJsonFilePath'; - UpdateViaJsonString = 'Az.DeviceRegistry.private\Update-AzDeviceRegistryNamespaceDevice_UpdateViaJsonString'; - } - if (('UpdateExpanded', 'UpdateViaJsonFilePath', 'UpdateViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { - 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.DeviceRegistry.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.DeviceRegistry.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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) - if ($wrappedCmd -eq $null) { - $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) - } - $scriptCmd = {& $wrappedCmd @PSBoundParameters} - $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) - $steppablePipeline.Begin($PSCmdlet) - } 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.DeviceRegistry.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 -Update a NamespaceDiscoveredAsset -.Description -Update a NamespaceDiscoveredAsset -.Example -Update-AzDeviceRegistryNamespaceDiscoveredAsset -ResourceGroupName "my-resource-group" -NamespaceName "my-namespace" -DiscoveredAssetName "my-discovered-asset" -DocumentationUri "https://www.example.com/docs" -SerialNumber "SN123456789" -.Example -$updateJson = '{ - "properties": { - "documentationUri": "https://www.example.com/docs", - "serialNumber": "SN123456789" - } -}' -Update-AzDeviceRegistryNamespaceDiscoveredAsset -ResourceGroupName "my-resource-group" -NamespaceName "my-namespace" -DiscoveredAssetName "my-discovered-asset" -JsonString $updateJson -.Example -Update-AzDeviceRegistryNamespaceDiscoveredAsset -ResourceGroupName "my-resource-group" -NamespaceName "my-namespace" -DiscoveredAssetName "my-discovered-asset" -JsonFilePath "C:\path\to\update-discovered-asset.json" -.Example -$namespaceIdentity = @{ - SubscriptionId = "00000000-0000-0000-0000-000000000000" - ResourceGroupName = "my-resource-group" - NamespaceName = "my-namespace" -} -Update-AzDeviceRegistryNamespaceDiscoveredAsset -NamespaceInputObject $namespaceIdentity -DiscoveredAssetName "my-discovered-asset" -DocumentationUri "https://www.example.com/docs" -SerialNumber "SN123456789" -.Example -Update-AzDeviceRegistryNamespaceDiscoveredAsset -InputObject $discoveredAssetObject -DocumentationUri "https://www.example.com/docs" -SerialNumber "SN123456789" - -.Inputs -Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IDeviceRegistryIdentity -.Outputs -Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDiscoveredAsset -.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. - -DATASET : Array of datasets that are part of the asset. Each dataset spec describes the data points that make up the set. - Name : Name of the dataset. - [DataPoint >]: Array of data points that are part of the dataset. Each data point can have per-data point configuration. - DataSource : The address of the source of the data in the asset (e.g. URL) so that a client can access the data source on the asset. - Name : The name of the data point. - [DataPointConfiguration ]: Stringified JSON that contains connector-specific configuration for the data point. For OPC UA, this could include configuration like, publishingInterval, samplingInterval, and queueSize. - [LastUpdatedOn ]: UTC timestamp indicating when the data point was added or modified. - [TypeRef ]: URI or type definition ID. - [DataSource ]: Reference to a data source for a given dataset. - [DatasetConfiguration ]: Stringified JSON that contains connector-specific properties that describes configuration for the specific dataset. - [Destination >]: Destinations for a dataset. - Target : Target destination. - [LastUpdatedOn ]: Timestamp (in UTC) indicating when the dataset was added or modified. - [TypeRef ]: URI or type definition ID. - -DEFAULTDATASETSDESTINATION : Default destinations for a dataset. - Target : Target destination. - -DEFAULTEVENTSDESTINATION : Default destinations for an event. - Target : Target destination. - -DEFAULTSTREAMSDESTINATION : Default destinations for a stream. - Target : Target destination. - -EVENTGROUP : Array of event groups that are part of the asset. Each event group can have per-event group configuration. - Name : The name of the event group. - [DataSource ]: The address of the notifier of the event group in the asset (e.g. URL) so that a client can access the event group on the asset. - [DefaultDestination >]: Destinations for events. Default destinations when destinations is not defined at the event level. - Target : Target destination. - [Event >]: Array of events that are part of the event group. - Name : The name of the event. - [DataSource ]: Reference to a data source for a given event. - [Destination >]: Destinations for an event. - [EventConfiguration ]: Stringified JSON that contains connector-specific configuration for the event. For OPC UA, this could include configuration like, publishingInterval, samplingInterval, and queueSize. - [LastUpdatedOn ]: UTC timestamp indicating when the event was added or modified. - [TypeRef ]: URI or type definition ID. - [EventGroupConfiguration ]: Stringified JSON that contains connector-specific configuration for the event group. For OPC UA, this could include configuration like, publishingInterval, samplingInterval, and queueSize. - [TypeRef ]: URI or type definition ID. - -INPUTOBJECT : Identity Parameter - [AssetEndpointProfileName ]: Asset Endpoint Profile name parameter. - [AssetName ]: Asset name parameter. - [BillingContainerName ]: Name of the billing container. - [DeviceName ]: The name of the device. - [DiscoveredAssetName ]: The name of the discovered asset. - [DiscoveredDeviceName ]: The name of the discovered device. - [Id ]: Resource identity path - [Location ]: The name of the Azure region. - [NamespaceName ]: The name of the namespace. - [OperationId ]: The ID of an ongoing async operation. - [PolicyName ]: The name of the Policy tracked resource. - [ResourceGroupName ]: The name of the resource group. The name is case insensitive. - [SchemaName ]: Schema name parameter. - [SchemaRegistryName ]: Schema registry name parameter. - [SchemaVersionName ]: Schema version name parameter. - [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. - -MANAGEMENTGROUP : Array of management groups that are part of the asset. Each management group can have a per-group configuration. - Name : Name of the management group. - [Action >]: Array of actions that are part of the management group. Each action can have an individual configuration. - Name : Name of the action. - TargetUri : The target URI on which a client can invoke the specific action. - [ActionConfiguration ]: Stringified JSON that contains connector-specific configuration for the action. - [ActionType ]: The type of the action. - [LastUpdatedOn ]: Timestamp (in UTC) indicating when the management action was added or modified. - [TimeoutInSecond ]: Response timeout for the action. - [Topic ]: The MQTT topic path on which a client will receive the request for the action. - [TypeRef ]: URI or type definition ID. - [DataSource ]: Reference to a data source for a given management group. - [DefaultTimeoutInSecond ]: Default response timeout for all actions that are part of the management group. - [DefaultTopic ]: Default MQTT topic path on which a client will receive the request for all actions that are part of the management group. - [LastUpdatedOn ]: Timestamp (in UTC) indicating when the management group was added or modified. - [ManagementGroupConfiguration ]: Stringified JSON that contains connector-specific configuration for the management group. - [TypeRef ]: URI or type definition ID. - -NAMESPACEINPUTOBJECT : Identity Parameter - [AssetEndpointProfileName ]: Asset Endpoint Profile name parameter. - [AssetName ]: Asset name parameter. - [BillingContainerName ]: Name of the billing container. - [DeviceName ]: The name of the device. - [DiscoveredAssetName ]: The name of the discovered asset. - [DiscoveredDeviceName ]: The name of the discovered device. - [Id ]: Resource identity path - [Location ]: The name of the Azure region. - [NamespaceName ]: The name of the namespace. - [OperationId ]: The ID of an ongoing async operation. - [PolicyName ]: The name of the Policy tracked resource. - [ResourceGroupName ]: The name of the resource group. The name is case insensitive. - [SchemaName ]: Schema name parameter. - [SchemaRegistryName ]: Schema registry name parameter. - [SchemaVersionName ]: Schema version name parameter. - [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. - -STREAM : Array of streams that are part of the asset. Each stream can have a per-stream configuration. - Name : Name of the stream definition. - [Destination >]: Destinations for a stream. - Target : Target destination. - [LastUpdatedOn ]: Timestamp (in UTC) indicating when the stream was added or modified. - [StreamConfiguration ]: Stringified JSON that contains connector-specific configuration for the specific stream. - [TypeRef ]: URI or type definition ID. -.Link -https://learn.microsoft.com/powershell/module/az.deviceregistry/update-azdeviceregistrynamespacediscoveredasset -#> -function Update-AzDeviceRegistryNamespaceDiscoveredAsset { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDiscoveredAsset])] -[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] -param( - [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] - [Parameter(ParameterSetName='UpdateViaIdentityNamespaceExpanded', Mandatory)] - [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] - [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Path')] - [System.String] - # The name of the discovered asset. - ${DiscoveredAssetName}, - - [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] - [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] - [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Path')] - [System.String] - # The name of the namespace. - ${NamespaceName}, - - [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] - [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] - [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Path')] - [System.String] - # The name of the resource group. - # The name is case insensitive. - ${ResourceGroupName}, - - [Parameter(ParameterSetName='UpdateExpanded')] - [Parameter(ParameterSetName='UpdateViaJsonFilePath')] - [Parameter(ParameterSetName='UpdateViaJsonString')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Path')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] - [System.String] - # The ID of the target subscription. - # The value must be an UUID. - ${SubscriptionId}, - - [Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory, ValueFromPipeline)] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Path')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IDeviceRegistryIdentity] - # Identity Parameter - ${InputObject}, - - [Parameter(ParameterSetName='UpdateViaIdentityNamespaceExpanded', Mandatory, ValueFromPipeline)] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Path')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IDeviceRegistryIdentity] - # Identity Parameter - ${NamespaceInputObject}, - - [Parameter(ParameterSetName='UpdateExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityNamespaceExpanded')] - [AllowEmptyCollection()] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] - [System.String[]] - # URIs or type definition IDs. - ${AssetTypeRef}, - - [Parameter(ParameterSetName='UpdateExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityNamespaceExpanded')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDiscoveredAssetUpdatePropertiesAttributes]))] - [System.Collections.Hashtable] - # A set of key-value pairs that contain custom attributes. - ${Attribute}, - - [Parameter(ParameterSetName='UpdateExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityNamespaceExpanded')] - [AllowEmptyCollection()] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDiscoveredDataset[]] - # Array of datasets that are part of the asset. - # Each dataset spec describes the data points that make up the set. - ${Dataset}, - - [Parameter(ParameterSetName='UpdateExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityNamespaceExpanded')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] - [System.String] - # Stringified JSON that contains connector-specific default configuration for all datasets. - # Each dataset can have its own configuration that overrides the default settings here. - ${DefaultDatasetsConfiguration}, - - [Parameter(ParameterSetName='UpdateExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityNamespaceExpanded')] - [AllowEmptyCollection()] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IDatasetDestination[]] - # Default destinations for a dataset. - ${DefaultDatasetsDestination}, - - [Parameter(ParameterSetName='UpdateExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityNamespaceExpanded')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] - [System.String] - # Stringified JSON that contains connector-specific default configuration for all events. - # Each event can have its own configuration that overrides the default settings here. - ${DefaultEventsConfiguration}, - - [Parameter(ParameterSetName='UpdateExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityNamespaceExpanded')] - [AllowEmptyCollection()] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IEventDestination[]] - # Default destinations for an event. - ${DefaultEventsDestination}, - - [Parameter(ParameterSetName='UpdateExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityNamespaceExpanded')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] - [System.String] - # Stringified JSON that contains connector-specific default configuration for all management groups. - # Each management group can have its own configuration that overrides the default settings here. - ${DefaultManagementGroupsConfiguration}, - - [Parameter(ParameterSetName='UpdateExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityNamespaceExpanded')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] - [System.String] - # Stringified JSON that contains connector-specific default configuration for all streams. - # Each stream can have its own configuration that overrides the default settings here. - ${DefaultStreamsConfiguration}, - - [Parameter(ParameterSetName='UpdateExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityNamespaceExpanded')] - [AllowEmptyCollection()] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IStreamDestination[]] - # Default destinations for a stream. - ${DefaultStreamsDestination}, - - [Parameter(ParameterSetName='UpdateExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityNamespaceExpanded')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] - [System.String] - # Human-readable description of the asset. - ${Description}, - - [Parameter(ParameterSetName='UpdateExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityNamespaceExpanded')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] - [System.String] - # Name of the device resource - ${DeviceRefDeviceName}, - - [Parameter(ParameterSetName='UpdateExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityNamespaceExpanded')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] - [System.String] - # The name of endpoint to use - ${DeviceRefEndpointName}, - - [Parameter(ParameterSetName='UpdateExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityNamespaceExpanded')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] - [System.String] - # Identifier used to detect changes in the asset. - ${DiscoveryId}, - - [Parameter(ParameterSetName='UpdateExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityNamespaceExpanded')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] - [System.String] - # Human-readable display name. - ${DisplayName}, - - [Parameter(ParameterSetName='UpdateExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityNamespaceExpanded')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] - [System.String] - # Asset documentation reference. - ${DocumentationUri}, - - [Parameter(ParameterSetName='UpdateExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityNamespaceExpanded')] - [AllowEmptyCollection()] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDiscoveredEventGroup[]] - # Array of event groups that are part of the asset. - # Each event group can have per-event group configuration. - ${EventGroup}, - - [Parameter(ParameterSetName='UpdateExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityNamespaceExpanded')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] - [System.String] - # Asset hardware revision number. - ${HardwareRevision}, - - [Parameter(ParameterSetName='UpdateExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityNamespaceExpanded')] - [AllowEmptyCollection()] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDiscoveredManagementGroup[]] - # Array of management groups that are part of the asset. - # Each management group can have a per-group configuration. - ${ManagementGroup}, - - [Parameter(ParameterSetName='UpdateExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityNamespaceExpanded')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] - [System.String] - # Asset manufacturer. - ${Manufacturer}, - - [Parameter(ParameterSetName='UpdateExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityNamespaceExpanded')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] - [System.String] - # Asset manufacturer URI. - ${ManufacturerUri}, - - [Parameter(ParameterSetName='UpdateExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityNamespaceExpanded')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] - [System.String] - # Asset model. - ${Model}, - - [Parameter(ParameterSetName='UpdateExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityNamespaceExpanded')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] - [System.String] - # Asset product code. - ${ProductCode}, - - [Parameter(ParameterSetName='UpdateExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityNamespaceExpanded')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] - [System.String] - # Asset serial number. - ${SerialNumber}, - - [Parameter(ParameterSetName='UpdateExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityNamespaceExpanded')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] - [System.String] - # Asset software revision number. - ${SoftwareRevision}, - - [Parameter(ParameterSetName='UpdateExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityNamespaceExpanded')] - [AllowEmptyCollection()] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDiscoveredStream[]] - # Array of streams that are part of the asset. - # Each stream can have a per-stream configuration. - ${Stream}, - - [Parameter(ParameterSetName='UpdateExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityNamespaceExpanded')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDiscoveredAssetUpdateTags]))] - [System.Collections.Hashtable] - # Resource tags. - ${Tag}, - - [Parameter(ParameterSetName='UpdateExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityNamespaceExpanded')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] - [System.Int64] - # An integer that is incremented each time the resource is modified. - ${Version}, - - [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] - [System.String] - # Path of Json file supplied to the Update operation - ${JsonFilePath}, - - [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] - [System.String] - # Json string supplied to the Update operation - ${JsonString}, - - [Parameter()] - [Alias('AzureRMContext', 'AzureCredential')] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category('Runtime')] - [System.Management.Automation.SwitchParameter] - # Run the command as a job - ${AsJob}, - - [Parameter(DontShow)] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Runtime')] - [System.Management.Automation.SwitchParameter] - # Wait for .NET debugger to attach - ${Break}, - - [Parameter(DontShow)] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Runtime')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SendAsyncStep[]] - # SendAsync Pipeline Steps to be appended to the front of the pipeline - ${HttpPipelineAppend}, - - [Parameter(DontShow)] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Runtime')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SendAsyncStep[]] - # SendAsync Pipeline Steps to be prepended to the front of the pipeline - ${HttpPipelinePrepend}, - - [Parameter()] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Runtime')] - [System.Management.Automation.SwitchParameter] - # Run the command asynchronously - ${NoWait}, - - [Parameter(DontShow)] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Runtime')] - [System.Uri] - # The URI for the proxy server to use - ${Proxy}, - - [Parameter(DontShow)] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Runtime')] - [System.Management.Automation.PSCredential] - # Credentials for a proxy server to use for the remote call - ${ProxyCredential}, - - [Parameter(DontShow)] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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 - - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } - - $context = Get-AzContext - if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit - } - - if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() - } - $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId - if ($preTelemetryId -eq '') { - [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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 = @{ - UpdateExpanded = 'Az.DeviceRegistry.private\Update-AzDeviceRegistryNamespaceDiscoveredAsset_UpdateExpanded'; - UpdateViaIdentityExpanded = 'Az.DeviceRegistry.private\Update-AzDeviceRegistryNamespaceDiscoveredAsset_UpdateViaIdentityExpanded'; - UpdateViaIdentityNamespaceExpanded = 'Az.DeviceRegistry.private\Update-AzDeviceRegistryNamespaceDiscoveredAsset_UpdateViaIdentityNamespaceExpanded'; - UpdateViaJsonFilePath = 'Az.DeviceRegistry.private\Update-AzDeviceRegistryNamespaceDiscoveredAsset_UpdateViaJsonFilePath'; - UpdateViaJsonString = 'Az.DeviceRegistry.private\Update-AzDeviceRegistryNamespaceDiscoveredAsset_UpdateViaJsonString'; - } - if (('UpdateExpanded', 'UpdateViaJsonFilePath', 'UpdateViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { - 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.DeviceRegistry.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.DeviceRegistry.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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) - if ($wrappedCmd -eq $null) { - $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) - } - $scriptCmd = {& $wrappedCmd @PSBoundParameters} - $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) - $steppablePipeline.Begin($PSCmdlet) - } 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.DeviceRegistry.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 -Update a NamespaceDiscoveredDevice -.Description -Update a NamespaceDiscoveredDevice -.Example -$endpointsInbound = @{ - "endpoint1" = @{ - Address = "https://my-inbound-endpoint1.westeurope-1.iothub.azure.net" - EndpointType = "Microsoft.Devices/IotHubs" - AuthenticationMethod = "Certificate" - X509CredentialsCertificateSecretName = "my-certificate" - } - "endpoint2" = @{ - Address = "https://myendpoint2.westeurope-1.iothub.azure.net" - EndpointType = "Microsoft.Devices/IotHubs" - AuthenticationMethod = "UsernamePassword" - UsernamePasswordCredentialsUsernameSecretName = "my-username-secret" - UsernamePasswordCredentialsPasswordSecretName = "my-password-secret" - } -} -Update-AzDeviceRegistryNamespaceDiscoveredDevice -ResourceGroupName "my-resource-group" -NamespaceName "my-namespace" -DiscoveredDeviceName "my-discovered-device" -OperatingSystemVersion "10.0.19041" -EndpointInbound $endpointsInbound -.Example -$updateJson = '{ - "properties": { - "operatingSystemVersion": "10.0.19041", - "endpointsInbound": { - "endpoint1": { - "address": "https://my-inbound-endpoint1.westeurope-1.iothub.azure.net", - "endpointType": "Microsoft.Devices/IotHubs", - "authentication": { - "method": "Certificate", - "x509Credentials": { - "certificateSecretName": "my-certificate" - } - } - }, - "endpoint2": { - "address": "https://my-inbound-endpoint2.westeurope-1.iothub.azure.net", - "endpointType": "Microsoft.Devices/IotHubs", - "authentication": { - "method": "UsernamePassword", - "usernamePasswordCredentials": { - "usernameSecretName": "my-username-secret", - "passwordSecretName": "my-password-secret" - } - } - } - } - } -}' -Update-AzDeviceRegistryNamespaceDiscoveredDevice -ResourceGroupName "my-resource-group" -NamespaceName "my-namespace" -DiscoveredDeviceName "my-discovered-device" -JsonString $updateJson -.Example -Update-AzDeviceRegistryNamespaceDiscoveredDevice -ResourceGroupName "my-resource-group" -NamespaceName "my-namespace" -DiscoveredDeviceName "my-discovered-device" -JsonFilePath "C:\path\to\update-discovered-device.json" -.Example -$namespaceIdentity = @{ - SubscriptionId = "00000000-0000-0000-0000-000000000000" - ResourceGroupName = "my-resource-group" - NamespaceName = "my-namespace" -} -$endpointsInbound = @{ - "endpoint1" = @{ - Address = "https://my-inbound-endpoint1.westeurope-1.iothub.azure.net" - EndpointType = "Microsoft.Devices/IotHubs" - AuthenticationMethod = "Certificate" - X509CredentialsCertificateSecretName = "my-certificate" - } - "endpoint2" = @{ - Address = "https://myendpoint2.westeurope-1.iothub.azure.net" - EndpointType = "Microsoft.Devices/IotHubs" - AuthenticationMethod = "UsernamePassword" - UsernamePasswordCredentialsUsernameSecretName = "my-username-secret" - UsernamePasswordCredentialsPasswordSecretName = "my-password-secret" - } -} -Update-AzDeviceRegistryNamespaceDiscoveredDevice -NamespaceInputObject $namespaceIdentity -DiscoveredDeviceName "my-discovered-device" -OperatingSystemVersion "10.0.19041" -EndpointInbound $endpointsInbound -.Example -$endpointsInbound = @{ - "endpoint1" = @{ - Address = "https://my-inbound-endpoint1.westeurope-1.iothub.azure.net" - EndpointType = "Microsoft.Devices/IotHubs" - AuthenticationMethod = "Certificate" - X509CredentialsCertificateSecretName = "my-certificate" - } - "endpoint2" = @{ - Address = "https://myendpoint2.westeurope-1.iothub.azure.net" - EndpointType = "Microsoft.Devices/IotHubs" - AuthenticationMethod = "UsernamePassword" - UsernamePasswordCredentialsUsernameSecretName = "my-username-secret" - UsernamePasswordCredentialsPasswordSecretName = "my-password-secret" - } -} -Update-AzDeviceRegistryNamespaceDiscoveredDevice -InputObject $discoveredDeviceObject -OperatingSystemVersion "10.0.19041" -EndpointInbound $endpointsInbound - -.Inputs -Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IDeviceRegistryIdentity -.Outputs -Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDiscoveredDevice -.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 - [AssetEndpointProfileName ]: Asset Endpoint Profile name parameter. - [AssetName ]: Asset name parameter. - [BillingContainerName ]: Name of the billing container. - [DeviceName ]: The name of the device. - [DiscoveredAssetName ]: The name of the discovered asset. - [DiscoveredDeviceName ]: The name of the discovered device. - [Id ]: Resource identity path - [Location ]: The name of the Azure region. - [NamespaceName ]: The name of the namespace. - [OperationId ]: The ID of an ongoing async operation. - [PolicyName ]: The name of the Policy tracked resource. - [ResourceGroupName ]: The name of the resource group. The name is case insensitive. - [SchemaName ]: Schema name parameter. - [SchemaRegistryName ]: Schema registry name parameter. - [SchemaVersionName ]: Schema version name parameter. - [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. + [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] + [System.String] + # Name of the device resource + ${DeviceRefDeviceName}, -NAMESPACEINPUTOBJECT : Identity Parameter - [AssetEndpointProfileName ]: Asset Endpoint Profile name parameter. - [AssetName ]: Asset name parameter. - [BillingContainerName ]: Name of the billing container. - [DeviceName ]: The name of the device. - [DiscoveredAssetName ]: The name of the discovered asset. - [DiscoveredDeviceName ]: The name of the discovered device. - [Id ]: Resource identity path - [Location ]: The name of the Azure region. - [NamespaceName ]: The name of the namespace. - [OperationId ]: The ID of an ongoing async operation. - [PolicyName ]: The name of the Policy tracked resource. - [ResourceGroupName ]: The name of the resource group. The name is case insensitive. - [SchemaName ]: Schema name parameter. - [SchemaRegistryName ]: Schema registry name parameter. - [SchemaVersionName ]: Schema version name parameter. - [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. -.Link -https://learn.microsoft.com/powershell/module/az.deviceregistry/update-azdeviceregistrynamespacediscovereddevice -#> -function Update-AzDeviceRegistryNamespaceDiscoveredDevice { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDiscoveredDevice])] -[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] -param( - [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] - [Parameter(ParameterSetName='UpdateViaIdentityNamespaceExpanded', Mandatory)] - [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] - [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Path')] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityNamespaceExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] [System.String] - # The name of the discovered device. - ${DiscoveredDeviceName}, + # The name of endpoint to use + ${DeviceRefEndpointName}, - [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] - [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] - [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Path')] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityNamespaceExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] [System.String] - # The name of the namespace. - ${NamespaceName}, + # Identifier used to detect changes in the asset. + ${DiscoveryId}, - [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] - [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] - [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Path')] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityNamespaceExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] [System.String] - # The name of the resource group. - # The name is case insensitive. - ${ResourceGroupName}, + # Human-readable display name. + ${DisplayName}, [Parameter(ParameterSetName='UpdateExpanded')] - [Parameter(ParameterSetName='UpdateViaJsonFilePath')] - [Parameter(ParameterSetName='UpdateViaJsonString')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Path')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityNamespaceExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] [System.String] - # The ID of the target subscription. - # The value must be an UUID. - ${SubscriptionId}, + # Asset documentation reference. + ${DocumentationUri}, - [Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory, ValueFromPipeline)] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Path')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IDeviceRegistryIdentity] - # Identity Parameter - ${InputObject}, + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityNamespaceExpanded')] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDiscoveredEventGroup[]] + # Array of event groups that are part of the asset. + # Each event group can have per-event group configuration. + ${EventGroup}, - [Parameter(ParameterSetName='UpdateViaIdentityNamespaceExpanded', Mandatory, ValueFromPipeline)] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Path')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IDeviceRegistryIdentity] - # Identity Parameter - ${NamespaceInputObject}, + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityNamespaceExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] + [System.String] + # Asset hardware revision number. + ${HardwareRevision}, [Parameter(ParameterSetName='UpdateExpanded')] [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Parameter(ParameterSetName='UpdateViaIdentityNamespaceExpanded')] + [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDiscoveredDeviceUpdatePropertiesAttributes]))] - [System.Collections.Hashtable] - # A set of key-value pairs that contain custom attributes. - ${Attribute}, + [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDiscoveredManagementGroup[]] + # Array of management groups that are part of the asset. + # Each management group can have a per-group configuration. + ${ManagementGroup}, [Parameter(ParameterSetName='UpdateExpanded')] [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Parameter(ParameterSetName='UpdateViaIdentityNamespaceExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] [System.String] - # Identifier used to detect changes in the discovered device. - ${DiscoveryId}, + # Asset manufacturer. + ${Manufacturer}, [Parameter(ParameterSetName='UpdateExpanded')] [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Parameter(ParameterSetName='UpdateViaIdentityNamespaceExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IDiscoveredMessagingEndpointsUpdateInbound]))] - [System.Collections.Hashtable] - # Set of endpoints to connect to the device. - ${EndpointInbound}, + [System.String] + # Asset manufacturer URI. + ${ManufacturerUri}, [Parameter(ParameterSetName='UpdateExpanded')] [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Parameter(ParameterSetName='UpdateViaIdentityNamespaceExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] [System.String] - # A device ID that represents the device in a system external to Azure. - # Unique within scope of an Azure tenant. - ${ExternalDeviceId}, + # Asset model. + ${Model}, [Parameter(ParameterSetName='UpdateExpanded')] [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Parameter(ParameterSetName='UpdateViaIdentityNamespaceExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] [System.String] - # Device operating system version. - ${OperatingSystemVersion}, + # Asset product code. + ${ProductCode}, [Parameter(ParameterSetName='UpdateExpanded')] [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Parameter(ParameterSetName='UpdateViaIdentityNamespaceExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IDiscoveredOutboundEndpointsUpdateAssigned]))] - [System.Collections.Hashtable] - # Endpoints the device can connect to. - ${OutboundAssigned}, + [System.String] + # Asset serial number. + ${SerialNumber}, [Parameter(ParameterSetName='UpdateExpanded')] [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Parameter(ParameterSetName='UpdateViaIdentityNamespaceExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDiscoveredDeviceUpdateTags]))] + [System.String] + # Asset software revision number. + ${SoftwareRevision}, + + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityNamespaceExpanded')] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDiscoveredStream[]] + # Array of streams that are part of the asset. + # Each stream can have a per-stream configuration. + ${Stream}, + + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityNamespaceExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDiscoveredAssetUpdateTags]))] [System.Collections.Hashtable] # Resource tags. ${Tag}, @@ -14249,11 +11704,11 @@ begin { } $mapping = @{ - UpdateExpanded = 'Az.DeviceRegistry.private\Update-AzDeviceRegistryNamespaceDiscoveredDevice_UpdateExpanded'; - UpdateViaIdentityExpanded = 'Az.DeviceRegistry.private\Update-AzDeviceRegistryNamespaceDiscoveredDevice_UpdateViaIdentityExpanded'; - UpdateViaIdentityNamespaceExpanded = 'Az.DeviceRegistry.private\Update-AzDeviceRegistryNamespaceDiscoveredDevice_UpdateViaIdentityNamespaceExpanded'; - UpdateViaJsonFilePath = 'Az.DeviceRegistry.private\Update-AzDeviceRegistryNamespaceDiscoveredDevice_UpdateViaJsonFilePath'; - UpdateViaJsonString = 'Az.DeviceRegistry.private\Update-AzDeviceRegistryNamespaceDiscoveredDevice_UpdateViaJsonString'; + UpdateExpanded = 'Az.DeviceRegistry.private\Update-AzDeviceRegistryNamespaceDiscoveredAsset_UpdateExpanded'; + UpdateViaIdentityExpanded = 'Az.DeviceRegistry.private\Update-AzDeviceRegistryNamespaceDiscoveredAsset_UpdateViaIdentityExpanded'; + UpdateViaIdentityNamespaceExpanded = 'Az.DeviceRegistry.private\Update-AzDeviceRegistryNamespaceDiscoveredAsset_UpdateViaIdentityNamespaceExpanded'; + UpdateViaJsonFilePath = 'Az.DeviceRegistry.private\Update-AzDeviceRegistryNamespaceDiscoveredAsset_UpdateViaJsonFilePath'; + UpdateViaJsonString = 'Az.DeviceRegistry.private\Update-AzDeviceRegistryNamespaceDiscoveredAsset_UpdateViaJsonString'; } if (('UpdateExpanded', 'UpdateViaJsonFilePath', 'UpdateViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { @@ -14317,32 +11772,102 @@ end { <# .Synopsis -Replace a Namespace +Update a NamespaceDiscoveredDevice .Description -Replace a Namespace +Update a NamespaceDiscoveredDevice .Example -$patchBody = @{ - "myendpoint1" = @{ - "resourceId" = "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/my-resource-group/providers/Microsoft.IotHub/namespaces/my-iothub-namespace" - "address" = "https://myendpoint1.westeurope-1.iothub.azure.net" - "endpointType" = "Microsoft.Devices/IotHubs" +$endpointsInbound = @{ + "endpoint1" = @{ + Address = "https://my-inbound-endpoint1.westeurope-1.iothub.azure.net" + EndpointType = "Microsoft.Devices/IotHubs" + AuthenticationMethod = "Certificate" + X509CredentialsCertificateSecretName = "my-certificate" + } + "endpoint2" = @{ + Address = "https://myendpoint2.westeurope-1.iothub.azure.net" + EndpointType = "Microsoft.Devices/IotHubs" + AuthenticationMethod = "UsernamePassword" + UsernamePasswordCredentialsUsernameSecretName = "my-username-secret" + UsernamePasswordCredentialsPasswordSecretName = "my-password-secret" } } -Update-AzDeviceRegistryNamespace -ResourceGroupName "my-resource-group" -Name "my-namespace" -MessagingEndpoint $patchBody +Update-AzDeviceRegistryNamespaceDiscoveredDevice -ResourceGroupName "my-resource-group" -NamespaceName "my-namespace" -DiscoveredDeviceName "my-discovered-device" -OperatingSystemVersion "10.0.19041" -EndpointInbound $endpointsInbound .Example -$patchBody = @{ - "myendpoint1" = @{ - "resourceId" = "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/my-resource-group/providers/Microsoft.IotHub/namespaces/my-iothub-namespace" - "address" = "https://myendpoint1.westeurope-1.iothub.azure.net" - "endpointType" = "Microsoft.Devices/IotHubs" +$updateJson = '{ + "properties": { + "operatingSystemVersion": "10.0.19041", + "endpointsInbound": { + "endpoint1": { + "address": "https://my-inbound-endpoint1.westeurope-1.iothub.azure.net", + "endpointType": "Microsoft.Devices/IotHubs", + "authentication": { + "method": "Certificate", + "x509Credentials": { + "certificateSecretName": "my-certificate" + } + } + }, + "endpoint2": { + "address": "https://my-inbound-endpoint2.westeurope-1.iothub.azure.net", + "endpointType": "Microsoft.Devices/IotHubs", + "authentication": { + "method": "UsernamePassword", + "usernamePasswordCredentials": { + "usernameSecretName": "my-username-secret", + "passwordSecretName": "my-password-secret" + } + } + } + } + } +}' +Update-AzDeviceRegistryNamespaceDiscoveredDevice -ResourceGroupName "my-resource-group" -NamespaceName "my-namespace" -DiscoveredDeviceName "my-discovered-device" -JsonString $updateJson +.Example +Update-AzDeviceRegistryNamespaceDiscoveredDevice -ResourceGroupName "my-resource-group" -NamespaceName "my-namespace" -DiscoveredDeviceName "my-discovered-device" -JsonFilePath "C:\path\to\update-discovered-device.json" +.Example +$namespaceIdentity = @{ + SubscriptionId = "00000000-0000-0000-0000-000000000000" + ResourceGroupName = "my-resource-group" + NamespaceName = "my-namespace" +} +$endpointsInbound = @{ + "endpoint1" = @{ + Address = "https://my-inbound-endpoint1.westeurope-1.iothub.azure.net" + EndpointType = "Microsoft.Devices/IotHubs" + AuthenticationMethod = "Certificate" + X509CredentialsCertificateSecretName = "my-certificate" + } + "endpoint2" = @{ + Address = "https://myendpoint2.westeurope-1.iothub.azure.net" + EndpointType = "Microsoft.Devices/IotHubs" + AuthenticationMethod = "UsernamePassword" + UsernamePasswordCredentialsUsernameSecretName = "my-username-secret" + UsernamePasswordCredentialsPasswordSecretName = "my-password-secret" + } +} +Update-AzDeviceRegistryNamespaceDiscoveredDevice -NamespaceInputObject $namespaceIdentity -DiscoveredDeviceName "my-discovered-device" -OperatingSystemVersion "10.0.19041" -EndpointInbound $endpointsInbound +.Example +$endpointsInbound = @{ + "endpoint1" = @{ + Address = "https://my-inbound-endpoint1.westeurope-1.iothub.azure.net" + EndpointType = "Microsoft.Devices/IotHubs" + AuthenticationMethod = "Certificate" + X509CredentialsCertificateSecretName = "my-certificate" + } + "endpoint2" = @{ + Address = "https://myendpoint2.westeurope-1.iothub.azure.net" + EndpointType = "Microsoft.Devices/IotHubs" + AuthenticationMethod = "UsernamePassword" + UsernamePasswordCredentialsUsernameSecretName = "my-username-secret" + UsernamePasswordCredentialsPasswordSecretName = "my-password-secret" } } -Update-AzDeviceRegistryNamespace -InputObject $namespaceIdentity -MessagingEndpoint $patchBody +Update-AzDeviceRegistryNamespaceDiscoveredDevice -InputObject $discoveredDeviceObject -OperatingSystemVersion "10.0.19041" -EndpointInbound $endpointsInbound .Inputs Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IDeviceRegistryIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespace +Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDiscoveredDevice .Notes COMPLEX PARAMETER PROPERTIES @@ -14359,27 +11884,55 @@ INPUTOBJECT : Identity Parameter [Location ]: The name of the Azure region. [NamespaceName ]: The name of the namespace. [OperationId ]: The ID of an ongoing async operation. - [PolicyName ]: The name of the Policy tracked resource. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [SchemaName ]: Schema name parameter. + [SchemaRegistryName ]: Schema registry name parameter. + [SchemaVersionName ]: Schema version name parameter. + [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. + +NAMESPACEINPUTOBJECT : Identity Parameter + [AssetEndpointProfileName ]: Asset Endpoint Profile name parameter. + [AssetName ]: Asset name parameter. + [BillingContainerName ]: Name of the billing container. + [DeviceName ]: The name of the device. + [DiscoveredAssetName ]: The name of the discovered asset. + [DiscoveredDeviceName ]: The name of the discovered device. + [Id ]: Resource identity path + [Location ]: The name of the Azure region. + [NamespaceName ]: The name of the namespace. + [OperationId ]: The ID of an ongoing async operation. [ResourceGroupName ]: The name of the resource group. The name is case insensitive. [SchemaName ]: Schema name parameter. [SchemaRegistryName ]: Schema registry name parameter. [SchemaVersionName ]: Schema version name parameter. [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. .Link -https://learn.microsoft.com/powershell/module/az.deviceregistry/update-azdeviceregistrynamespace +https://learn.microsoft.com/powershell/module/az.deviceregistry/update-azdeviceregistrynamespacediscovereddevice #> -function Update-AzDeviceRegistryNamespace { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespace])] +function Update-AzDeviceRegistryNamespaceDiscoveredDevice { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDiscoveredDevice])] [CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] - [Alias('NamespaceName')] + [Parameter(ParameterSetName='UpdateViaIdentityNamespaceExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Path')] + [System.String] + # The name of the discovered device. + ${DiscoveredDeviceName}, + + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Path')] [System.String] # The name of the namespace. - ${Name}, + ${NamespaceName}, [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Path')] [System.String] # The name of the resource group. @@ -14387,6 +11940,8 @@ param( ${ResourceGroupName}, [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaJsonFilePath')] + [Parameter(ParameterSetName='UpdateViaJsonString')] [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] @@ -14400,26 +11955,93 @@ param( # Identity Parameter ${InputObject}, - [Parameter()] + [Parameter(ParameterSetName='UpdateViaIdentityNamespaceExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IDeviceRegistryIdentity] + # Identity Parameter + ${NamespaceInputObject}, + + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityNamespaceExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] - [System.Nullable[System.Boolean]] - # Determines whether to enable a system-assigned identity for the resource. - ${EnableSystemAssignedIdentity}, + [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDiscoveredDeviceUpdatePropertiesAttributes]))] + [System.Collections.Hashtable] + # A set of key-value pairs that contain custom attributes. + ${Attribute}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityNamespaceExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IMessagingEndpoints]))] + [System.String] + # Identifier used to detect changes in the discovered device. + ${DiscoveryId}, + + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityNamespaceExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IDiscoveredMessagingEndpointsUpdateInbound]))] [System.Collections.Hashtable] - # Dictionary of messaging endpoints. - ${MessagingEndpoint}, + # Set of endpoints to connect to the device. + ${EndpointInbound}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityNamespaceExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ITrackedResourceTags]))] + [System.String] + # A device ID that represents the device in a system external to Azure. + # Unique within scope of an Azure tenant. + ${ExternalDeviceId}, + + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityNamespaceExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] + [System.String] + # Device operating system version. + ${OperatingSystemVersion}, + + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityNamespaceExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IDiscoveredOutboundEndpointsUpdateAssigned]))] + [System.Collections.Hashtable] + # Endpoints the device can connect to. + ${OutboundAssigned}, + + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityNamespaceExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDiscoveredDeviceUpdateTags]))] [System.Collections.Hashtable] # Resource tags. ${Tag}, + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityNamespaceExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] + [System.Int64] + # An integer that is incremented each time the resource is modified. + ${Version}, + + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] + [System.String] + # Path of Json file supplied to the Update operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] + [System.String] + # Json string supplied to the Update operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -14516,10 +12138,13 @@ begin { } $mapping = @{ - UpdateExpanded = 'Az.DeviceRegistry.private\Update-AzDeviceRegistryNamespace_UpdateExpanded'; - UpdateViaIdentityExpanded = 'Az.DeviceRegistry.private\Update-AzDeviceRegistryNamespace_UpdateViaIdentityExpanded'; + UpdateExpanded = 'Az.DeviceRegistry.private\Update-AzDeviceRegistryNamespaceDiscoveredDevice_UpdateExpanded'; + UpdateViaIdentityExpanded = 'Az.DeviceRegistry.private\Update-AzDeviceRegistryNamespaceDiscoveredDevice_UpdateViaIdentityExpanded'; + UpdateViaIdentityNamespaceExpanded = 'Az.DeviceRegistry.private\Update-AzDeviceRegistryNamespaceDiscoveredDevice_UpdateViaIdentityNamespaceExpanded'; + UpdateViaJsonFilePath = 'Az.DeviceRegistry.private\Update-AzDeviceRegistryNamespaceDiscoveredDevice_UpdateViaJsonFilePath'; + UpdateViaJsonString = 'Az.DeviceRegistry.private\Update-AzDeviceRegistryNamespaceDiscoveredDevice_UpdateViaJsonString'; } - if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { + if (('UpdateExpanded', 'UpdateViaJsonFilePath', 'UpdateViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -14581,52 +12206,32 @@ end { <# .Synopsis -Update a Policy +Replace a Namespace .Description -Update a Policy +Replace a Namespace .Example -$jsonString = @" -{ - "properties": { - "certificate": { - "leafCertificateConfiguration": { - "validityPeriodInDays": 60 - } - } +$patchBody = @{ + "myendpoint1" = @{ + "resourceId" = "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/my-resource-group/providers/Microsoft.IotHub/namespaces/my-iothub-namespace" + "address" = "https://myendpoint1.westeurope-1.iothub.azure.net" + "endpointType" = "Microsoft.Devices/IotHubs" } } -"@ - -Update-AzDeviceRegistryPolicy -Name my-policy -NamespaceName my-namespace -ResourceGroupName my-resource-group -JsonString $jsonString +Update-AzDeviceRegistryNamespace -ResourceGroupName "my-resource-group" -Name "my-namespace" -MessagingEndpoint $patchBody .Example -$jsonString = @" -{ - "tags": { - "environment": "production", - "team": "iot", - "updated": "true" +$patchBody = @{ + "myendpoint1" = @{ + "resourceId" = "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/my-resource-group/providers/Microsoft.IotHub/namespaces/my-iothub-namespace" + "address" = "https://myendpoint1.westeurope-1.iothub.azure.net" + "endpointType" = "Microsoft.Devices/IotHubs" } } -"@ - -Update-AzDeviceRegistryPolicy -Name my-policy -NamespaceName my-namespace -ResourceGroupName my-resource-group -JsonString $jsonString -.Example -Update-AzDeviceRegistryPolicy -Name my-policy -NamespaceName my-namespace -ResourceGroupName my-resource-group -JsonFilePath "C:\policies\policy-update.json" -.Example -$policyIdentity = @{ - SubscriptionId = "xxxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx" - ResourceGroupName = "my-resource-group" - NamespaceName = "my-namespace" - CredentialName = "default" - PolicyName = "my-policy-name" -} - -Update-AzDeviceRegistryPolicy -InputObject $policyIdentity -Tag @{"environment" = "staging"} +Update-AzDeviceRegistryNamespace -InputObject $namespaceIdentity -MessagingEndpoint $patchBody .Inputs Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IDeviceRegistryIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicy +Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespace .Notes COMPLEX PARAMETER PROPERTIES @@ -14643,58 +12248,26 @@ INPUTOBJECT : Identity Parameter [Location ]: The name of the Azure region. [NamespaceName ]: The name of the namespace. [OperationId ]: The ID of an ongoing async operation. - [PolicyName ]: The name of the Policy tracked resource. - [ResourceGroupName ]: The name of the resource group. The name is case insensitive. - [SchemaName ]: Schema name parameter. - [SchemaRegistryName ]: Schema registry name parameter. - [SchemaVersionName ]: Schema version name parameter. - [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. - -NAMESPACEINPUTOBJECT : Identity Parameter - [AssetEndpointProfileName ]: Asset Endpoint Profile name parameter. - [AssetName ]: Asset name parameter. - [BillingContainerName ]: Name of the billing container. - [DeviceName ]: The name of the device. - [DiscoveredAssetName ]: The name of the discovered asset. - [DiscoveredDeviceName ]: The name of the discovered device. - [Id ]: Resource identity path - [Location ]: The name of the Azure region. - [NamespaceName ]: The name of the namespace. - [OperationId ]: The ID of an ongoing async operation. - [PolicyName ]: The name of the Policy tracked resource. [ResourceGroupName ]: The name of the resource group. The name is case insensitive. [SchemaName ]: Schema name parameter. [SchemaRegistryName ]: Schema registry name parameter. [SchemaVersionName ]: Schema version name parameter. [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. .Link -https://learn.microsoft.com/powershell/module/az.deviceregistry/update-azdeviceregistrypolicy +https://learn.microsoft.com/powershell/module/az.deviceregistry/update-azdeviceregistrynamespace #> -function Update-AzDeviceRegistryPolicy { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicy])] +function Update-AzDeviceRegistryNamespace { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespace])] [CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] - [Parameter(ParameterSetName='UpdateViaIdentityNamespaceExpanded', Mandatory)] - [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] - [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] - [Alias('PolicyName')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Path')] - [System.String] - # The name of the Policy tracked resource. - ${Name}, - - [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] - [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] - [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] + [Alias('NamespaceName')] [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Path')] [System.String] # The name of the namespace. - ${NamespaceName}, + ${Name}, [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] - [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] - [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Path')] [System.String] # The name of the resource group. @@ -14702,8 +12275,6 @@ param( ${ResourceGroupName}, [Parameter(ParameterSetName='UpdateExpanded')] - [Parameter(ParameterSetName='UpdateViaJsonFilePath')] - [Parameter(ParameterSetName='UpdateViaJsonString')] [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] @@ -14717,49 +12288,26 @@ param( # Identity Parameter ${InputObject}, - [Parameter(ParameterSetName='UpdateViaIdentityNamespaceExpanded', Mandatory, ValueFromPipeline)] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Path')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IDeviceRegistryIdentity] - # Identity Parameter - ${NamespaceInputObject}, - - [Parameter(ParameterSetName='UpdateExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityNamespaceExpanded')] + [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAny] - # The configuration to set up an ICA. - ${CertificateAuthorityConfiguration}, + [System.Nullable[System.Boolean]] + # Determines whether to enable a system-assigned identity for the resource. + ${EnableSystemAssignedIdentity}, - [Parameter(ParameterSetName='UpdateExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityNamespaceExpanded')] + [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] - [System.Int32] - # The validity period in days. - ${LeafCertificateConfigurationValidityPeriodInDay}, + [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IMessagingEndpoints]))] + [System.Collections.Hashtable] + # Dictionary of messaging endpoints. + ${MessagingEndpoint}, - [Parameter(ParameterSetName='UpdateExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityNamespaceExpanded')] + [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyUpdateTags]))] + [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ITrackedResourceTags]))] [System.Collections.Hashtable] # Resource tags. ${Tag}, - [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] - [System.String] - # Path of Json file supplied to the Update operation - ${JsonFilePath}, - - [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] - [System.String] - # Json string supplied to the Update operation - ${JsonString}, - [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -14856,13 +12404,10 @@ begin { } $mapping = @{ - UpdateExpanded = 'Az.DeviceRegistry.private\Update-AzDeviceRegistryPolicy_UpdateExpanded'; - UpdateViaIdentityExpanded = 'Az.DeviceRegistry.private\Update-AzDeviceRegistryPolicy_UpdateViaIdentityExpanded'; - UpdateViaIdentityNamespaceExpanded = 'Az.DeviceRegistry.private\Update-AzDeviceRegistryPolicy_UpdateViaIdentityNamespaceExpanded'; - UpdateViaJsonFilePath = 'Az.DeviceRegistry.private\Update-AzDeviceRegistryPolicy_UpdateViaJsonFilePath'; - UpdateViaJsonString = 'Az.DeviceRegistry.private\Update-AzDeviceRegistryPolicy_UpdateViaJsonString'; + UpdateExpanded = 'Az.DeviceRegistry.private\Update-AzDeviceRegistryNamespace_UpdateExpanded'; + UpdateViaIdentityExpanded = 'Az.DeviceRegistry.private\Update-AzDeviceRegistryNamespace_UpdateViaIdentityExpanded'; } - if (('UpdateExpanded', 'UpdateViaJsonFilePath', 'UpdateViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { + if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -14957,7 +12502,6 @@ INPUTOBJECT : Identity Parameter [Location ]: The name of the Azure region. [NamespaceName ]: The name of the namespace. [OperationId ]: The ID of an ongoing async operation. - [PolicyName ]: The name of the Policy tracked resource. [ResourceGroupName ]: The name of the resource group. The name is case insensitive. [SchemaName ]: Schema name parameter. [SchemaRegistryName ]: Schema registry name parameter. @@ -15218,7 +12762,6 @@ INPUTOBJECT : Identity Parameter [Location ]: The name of the Azure region. [NamespaceName ]: The name of the namespace. [OperationId ]: The ID of an ongoing async operation. - [PolicyName ]: The name of the Policy tracked resource. [ResourceGroupName ]: The name of the resource group. The name is case insensitive. [SchemaName ]: Schema name parameter. [SchemaRegistryName ]: Schema registry name parameter. @@ -15236,7 +12779,6 @@ SCHEMAINPUTOBJECT : Identity Parameter [Location ]: The name of the Azure region. [NamespaceName ]: The name of the namespace. [OperationId ]: The ID of an ongoing async operation. - [PolicyName ]: The name of the Policy tracked resource. [ResourceGroupName ]: The name of the resource group. The name is case insensitive. [SchemaName ]: Schema name parameter. [SchemaRegistryName ]: Schema registry name parameter. @@ -15254,7 +12796,6 @@ SCHEMAREGISTRYINPUTOBJECT : Identity Parameter [Location ]: The name of the Azure region. [NamespaceName ]: The name of the namespace. [OperationId ]: The ID of an ongoing async operation. - [PolicyName ]: The name of the Policy tracked resource. [ResourceGroupName ]: The name of the resource group. The name is case insensitive. [SchemaName ]: Schema name parameter. [SchemaRegistryName ]: Schema registry name parameter. @@ -15514,7 +13055,6 @@ INPUTOBJECT : Identity Parameter [Location ]: The name of the Azure region. [NamespaceName ]: The name of the namespace. [OperationId ]: The ID of an ongoing async operation. - [PolicyName ]: The name of the Policy tracked resource. [ResourceGroupName ]: The name of the resource group. The name is case insensitive. [SchemaName ]: Schema name parameter. [SchemaRegistryName ]: Schema registry name parameter. @@ -15532,7 +13072,6 @@ SCHEMAREGISTRYINPUTOBJECT : Identity Parameter [Location ]: The name of the Azure region. [NamespaceName ]: The name of the namespace. [OperationId ]: The ID of an ongoing async operation. - [PolicyName ]: The name of the Policy tracked resource. [ResourceGroupName ]: The name of the resource group. The name is case insensitive. [SchemaName ]: Schema name parameter. [SchemaRegistryName ]: Schema registry name parameter. diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/exports/Remove-AzDeviceRegistryAsset.ps1 b/generated/DeviceRegistry/DeviceRegistry.Autorest/exports/Remove-AzDeviceRegistryAsset.ps1 index eb71f747e69a..649cf014ea69 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/exports/Remove-AzDeviceRegistryAsset.ps1 +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/exports/Remove-AzDeviceRegistryAsset.ps1 @@ -45,7 +45,6 @@ INPUTOBJECT : Identity Parameter [Location ]: The name of the Azure region. [NamespaceName ]: The name of the namespace. [OperationId ]: The ID of an ongoing async operation. - [PolicyName ]: The name of the Policy tracked resource. [ResourceGroupName ]: The name of the resource group. The name is case insensitive. [SchemaName ]: Schema name parameter. [SchemaRegistryName ]: Schema registry name parameter. diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/exports/Remove-AzDeviceRegistryAssetEndpointProfile.ps1 b/generated/DeviceRegistry/DeviceRegistry.Autorest/exports/Remove-AzDeviceRegistryAssetEndpointProfile.ps1 index b2b902459ebb..e86ebffdb5af 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/exports/Remove-AzDeviceRegistryAssetEndpointProfile.ps1 +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/exports/Remove-AzDeviceRegistryAssetEndpointProfile.ps1 @@ -45,7 +45,6 @@ INPUTOBJECT : Identity Parameter [Location ]: The name of the Azure region. [NamespaceName ]: The name of the namespace. [OperationId ]: The ID of an ongoing async operation. - [PolicyName ]: The name of the Policy tracked resource. [ResourceGroupName ]: The name of the resource group. The name is case insensitive. [SchemaName ]: Schema name parameter. [SchemaRegistryName ]: Schema registry name parameter. diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/exports/Remove-AzDeviceRegistryCredentials.ps1 b/generated/DeviceRegistry/DeviceRegistry.Autorest/exports/Remove-AzDeviceRegistryCredentials.ps1 deleted file mode 100644 index 9521b1051f82..000000000000 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/exports/Remove-AzDeviceRegistryCredentials.ps1 +++ /dev/null @@ -1,265 +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 -Delete a Credential -.Description -Delete a Credential -.Example -Remove-AzDeviceRegistryCredentials -NamespaceName my-namespace -ResourceGroupName my-resource-group -.Example -Remove-AzDeviceRegistryCredentials -NamespaceName my-namespace -ResourceGroupName my-resource-group -Confirm -.Example -Remove-AzDeviceRegistryCredentials -NamespaceName my-namespace -ResourceGroupName my-resource-group -Confirm:$false -.Example -$credentialsIdentity = @{ - SubscriptionId = "xxxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx" - ResourceGroupName = "my-resource-group" - NamespaceName = "my-namespace" -} -Remove-AzDeviceRegistryCredentials -InputObject $credentialsIdentity -Confirm:$false -.Example -# First remove all policies -Get-AzDeviceRegistryPolicy -NamespaceName my-namespace -ResourceGroupName my-resource-group | Remove-AzDeviceRegistryPolicy -Confirm:$false - -# Then remove credentials -Remove-AzDeviceRegistryCredentials -NamespaceName my-namespace -ResourceGroupName my-resource-group -Confirm:$false - -.Inputs -Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IDeviceRegistryIdentity -.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 - [AssetEndpointProfileName ]: Asset Endpoint Profile name parameter. - [AssetName ]: Asset name parameter. - [BillingContainerName ]: Name of the billing container. - [DeviceName ]: The name of the device. - [DiscoveredAssetName ]: The name of the discovered asset. - [DiscoveredDeviceName ]: The name of the discovered device. - [Id ]: Resource identity path - [Location ]: The name of the Azure region. - [NamespaceName ]: The name of the namespace. - [OperationId ]: The ID of an ongoing async operation. - [PolicyName ]: The name of the Policy tracked resource. - [ResourceGroupName ]: The name of the resource group. The name is case insensitive. - [SchemaName ]: Schema name parameter. - [SchemaRegistryName ]: Schema registry name parameter. - [SchemaVersionName ]: Schema version name parameter. - [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. -.Link -https://learn.microsoft.com/powershell/module/az.deviceregistry/remove-azdeviceregistrycredentials -#> -function Remove-AzDeviceRegistryCredentials { -[OutputType([System.Boolean])] -[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] -param( - [Parameter(ParameterSetName='Delete', Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Path')] - [System.String] - # The name of the namespace. - ${NamespaceName}, - - [Parameter(ParameterSetName='Delete', Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Path')] - [System.String] - # The name of the resource group. - # The name is case insensitive. - ${ResourceGroupName}, - - [Parameter(ParameterSetName='Delete')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Path')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] - [System.String] - # The ID of the target subscription. - # The value must be an UUID. - ${SubscriptionId}, - - [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Path')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IDeviceRegistryIdentity] - # Identity Parameter - ${InputObject}, - - [Parameter()] - [Alias('AzureRMContext', 'AzureCredential')] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category('Runtime')] - [System.Management.Automation.SwitchParameter] - # Run the command as a job - ${AsJob}, - - [Parameter(DontShow)] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Runtime')] - [System.Management.Automation.SwitchParameter] - # Wait for .NET debugger to attach - ${Break}, - - [Parameter(DontShow)] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Runtime')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SendAsyncStep[]] - # SendAsync Pipeline Steps to be appended to the front of the pipeline - ${HttpPipelineAppend}, - - [Parameter(DontShow)] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Runtime')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SendAsyncStep[]] - # SendAsync Pipeline Steps to be prepended to the front of the pipeline - ${HttpPipelinePrepend}, - - [Parameter()] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Runtime')] - [System.Management.Automation.SwitchParameter] - # Run the command asynchronously - ${NoWait}, - - [Parameter()] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Runtime')] - [System.Management.Automation.SwitchParameter] - # Returns true when the command succeeds - ${PassThru}, - - [Parameter(DontShow)] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Runtime')] - [System.Uri] - # The URI for the proxy server to use - ${Proxy}, - - [Parameter(DontShow)] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Runtime')] - [System.Management.Automation.PSCredential] - # Credentials for a proxy server to use for the remote call - ${ProxyCredential}, - - [Parameter(DontShow)] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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 - - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } - - $context = Get-AzContext - if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit - } - - if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() - } - $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId - if ($preTelemetryId -eq '') { - [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.private\Remove-AzDeviceRegistryCredentials_Delete'; - DeleteViaIdentity = 'Az.DeviceRegistry.private\Remove-AzDeviceRegistryCredentials_DeleteViaIdentity'; - } - if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { - 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.DeviceRegistry.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.DeviceRegistry.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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) - if ($wrappedCmd -eq $null) { - $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) - } - $scriptCmd = {& $wrappedCmd @PSBoundParameters} - $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) - $steppablePipeline.Begin($PSCmdlet) - } 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.DeviceRegistry.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/DeviceRegistry/DeviceRegistry.Autorest/exports/Remove-AzDeviceRegistryNamespace.ps1 b/generated/DeviceRegistry/DeviceRegistry.Autorest/exports/Remove-AzDeviceRegistryNamespace.ps1 index 617c0db34007..9688fe1f88dc 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/exports/Remove-AzDeviceRegistryNamespace.ps1 +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/exports/Remove-AzDeviceRegistryNamespace.ps1 @@ -45,7 +45,6 @@ INPUTOBJECT : Identity Parameter [Location ]: The name of the Azure region. [NamespaceName ]: The name of the namespace. [OperationId ]: The ID of an ongoing async operation. - [PolicyName ]: The name of the Policy tracked resource. [ResourceGroupName ]: The name of the resource group. The name is case insensitive. [SchemaName ]: Schema name parameter. [SchemaRegistryName ]: Schema registry name parameter. diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/exports/Remove-AzDeviceRegistryNamespaceAsset.ps1 b/generated/DeviceRegistry/DeviceRegistry.Autorest/exports/Remove-AzDeviceRegistryNamespaceAsset.ps1 index ddd2d0ebcce4..2e3c43b56be4 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/exports/Remove-AzDeviceRegistryNamespaceAsset.ps1 +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/exports/Remove-AzDeviceRegistryNamespaceAsset.ps1 @@ -52,7 +52,6 @@ INPUTOBJECT : Identity Parameter [Location ]: The name of the Azure region. [NamespaceName ]: The name of the namespace. [OperationId ]: The ID of an ongoing async operation. - [PolicyName ]: The name of the Policy tracked resource. [ResourceGroupName ]: The name of the resource group. The name is case insensitive. [SchemaName ]: Schema name parameter. [SchemaRegistryName ]: Schema registry name parameter. @@ -70,7 +69,6 @@ NAMESPACEINPUTOBJECT : Identity Parameter [Location ]: The name of the Azure region. [NamespaceName ]: The name of the namespace. [OperationId ]: The ID of an ongoing async operation. - [PolicyName ]: The name of the Policy tracked resource. [ResourceGroupName ]: The name of the resource group. The name is case insensitive. [SchemaName ]: Schema name parameter. [SchemaRegistryName ]: Schema registry name parameter. diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/exports/Remove-AzDeviceRegistryNamespaceDevice.ps1 b/generated/DeviceRegistry/DeviceRegistry.Autorest/exports/Remove-AzDeviceRegistryNamespaceDevice.ps1 index 6f0ef99afdff..f7e49fc6dd18 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/exports/Remove-AzDeviceRegistryNamespaceDevice.ps1 +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/exports/Remove-AzDeviceRegistryNamespaceDevice.ps1 @@ -52,7 +52,6 @@ INPUTOBJECT : Identity Parameter [Location ]: The name of the Azure region. [NamespaceName ]: The name of the namespace. [OperationId ]: The ID of an ongoing async operation. - [PolicyName ]: The name of the Policy tracked resource. [ResourceGroupName ]: The name of the resource group. The name is case insensitive. [SchemaName ]: Schema name parameter. [SchemaRegistryName ]: Schema registry name parameter. @@ -70,7 +69,6 @@ NAMESPACEINPUTOBJECT : Identity Parameter [Location ]: The name of the Azure region. [NamespaceName ]: The name of the namespace. [OperationId ]: The ID of an ongoing async operation. - [PolicyName ]: The name of the Policy tracked resource. [ResourceGroupName ]: The name of the resource group. The name is case insensitive. [SchemaName ]: Schema name parameter. [SchemaRegistryName ]: Schema registry name parameter. diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/exports/Remove-AzDeviceRegistryNamespaceDiscoveredAsset.ps1 b/generated/DeviceRegistry/DeviceRegistry.Autorest/exports/Remove-AzDeviceRegistryNamespaceDiscoveredAsset.ps1 index 36f1098eea58..63b734efe4a7 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/exports/Remove-AzDeviceRegistryNamespaceDiscoveredAsset.ps1 +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/exports/Remove-AzDeviceRegistryNamespaceDiscoveredAsset.ps1 @@ -52,7 +52,6 @@ INPUTOBJECT : Identity Parameter [Location ]: The name of the Azure region. [NamespaceName ]: The name of the namespace. [OperationId ]: The ID of an ongoing async operation. - [PolicyName ]: The name of the Policy tracked resource. [ResourceGroupName ]: The name of the resource group. The name is case insensitive. [SchemaName ]: Schema name parameter. [SchemaRegistryName ]: Schema registry name parameter. @@ -70,7 +69,6 @@ NAMESPACEINPUTOBJECT : Identity Parameter [Location ]: The name of the Azure region. [NamespaceName ]: The name of the namespace. [OperationId ]: The ID of an ongoing async operation. - [PolicyName ]: The name of the Policy tracked resource. [ResourceGroupName ]: The name of the resource group. The name is case insensitive. [SchemaName ]: Schema name parameter. [SchemaRegistryName ]: Schema registry name parameter. diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/exports/Remove-AzDeviceRegistryNamespaceDiscoveredDevice.ps1 b/generated/DeviceRegistry/DeviceRegistry.Autorest/exports/Remove-AzDeviceRegistryNamespaceDiscoveredDevice.ps1 index acce6b98c4a3..05c5aedb7bba 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/exports/Remove-AzDeviceRegistryNamespaceDiscoveredDevice.ps1 +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/exports/Remove-AzDeviceRegistryNamespaceDiscoveredDevice.ps1 @@ -52,7 +52,6 @@ INPUTOBJECT : Identity Parameter [Location ]: The name of the Azure region. [NamespaceName ]: The name of the namespace. [OperationId ]: The ID of an ongoing async operation. - [PolicyName ]: The name of the Policy tracked resource. [ResourceGroupName ]: The name of the resource group. The name is case insensitive. [SchemaName ]: Schema name parameter. [SchemaRegistryName ]: Schema registry name parameter. @@ -70,7 +69,6 @@ NAMESPACEINPUTOBJECT : Identity Parameter [Location ]: The name of the Azure region. [NamespaceName ]: The name of the namespace. [OperationId ]: The ID of an ongoing async operation. - [PolicyName ]: The name of the Policy tracked resource. [ResourceGroupName ]: The name of the resource group. The name is case insensitive. [SchemaName ]: Schema name parameter. [SchemaRegistryName ]: Schema registry name parameter. diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/exports/Remove-AzDeviceRegistryPolicy.ps1 b/generated/DeviceRegistry/DeviceRegistry.Autorest/exports/Remove-AzDeviceRegistryPolicy.ps1 deleted file mode 100644 index 934e88f194b3..000000000000 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/exports/Remove-AzDeviceRegistryPolicy.ps1 +++ /dev/null @@ -1,296 +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 -Delete a Policy -.Description -Delete a Policy -.Example -Remove-AzDeviceRegistryPolicy -Name my-policy -NamespaceName my-namespace -ResourceGroupName my-resource-group -.Example -Remove-AzDeviceRegistryPolicy -Name my-policy -NamespaceName my-namespace -ResourceGroupName my-resource-group -Confirm -.Example -Remove-AzDeviceRegistryPolicy -Name my-policy -NamespaceName my-namespace -ResourceGroupName my-resource-group -Confirm:$false -.Example -$policyIdentity = @{ - SubscriptionId = "xxxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx" - ResourceGroupName = "my-resource-group" - NamespaceName = "my-namespace" - CredentialName = "default" - PolicyName = "my-policy-name" -} -Remove-AzDeviceRegistryPolicy -InputObject $policyIdentity -Confirm:$false -.Example -Get-AzDeviceRegistryPolicy -NamespaceName my-namespace -ResourceGroupName my-resource-group | Where-Object { $_.Tag.environment -eq "test" } | Remove-AzDeviceRegistryPolicy -Confirm:$false - -.Inputs -Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IDeviceRegistryIdentity -.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 - [AssetEndpointProfileName ]: Asset Endpoint Profile name parameter. - [AssetName ]: Asset name parameter. - [BillingContainerName ]: Name of the billing container. - [DeviceName ]: The name of the device. - [DiscoveredAssetName ]: The name of the discovered asset. - [DiscoveredDeviceName ]: The name of the discovered device. - [Id ]: Resource identity path - [Location ]: The name of the Azure region. - [NamespaceName ]: The name of the namespace. - [OperationId ]: The ID of an ongoing async operation. - [PolicyName ]: The name of the Policy tracked resource. - [ResourceGroupName ]: The name of the resource group. The name is case insensitive. - [SchemaName ]: Schema name parameter. - [SchemaRegistryName ]: Schema registry name parameter. - [SchemaVersionName ]: Schema version name parameter. - [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. - -NAMESPACEINPUTOBJECT : Identity Parameter - [AssetEndpointProfileName ]: Asset Endpoint Profile name parameter. - [AssetName ]: Asset name parameter. - [BillingContainerName ]: Name of the billing container. - [DeviceName ]: The name of the device. - [DiscoveredAssetName ]: The name of the discovered asset. - [DiscoveredDeviceName ]: The name of the discovered device. - [Id ]: Resource identity path - [Location ]: The name of the Azure region. - [NamespaceName ]: The name of the namespace. - [OperationId ]: The ID of an ongoing async operation. - [PolicyName ]: The name of the Policy tracked resource. - [ResourceGroupName ]: The name of the resource group. The name is case insensitive. - [SchemaName ]: Schema name parameter. - [SchemaRegistryName ]: Schema registry name parameter. - [SchemaVersionName ]: Schema version name parameter. - [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. -.Link -https://learn.microsoft.com/powershell/module/az.deviceregistry/remove-azdeviceregistrypolicy -#> -function Remove-AzDeviceRegistryPolicy { -[OutputType([System.Boolean])] -[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] -param( - [Parameter(ParameterSetName='Delete', Mandatory)] - [Parameter(ParameterSetName='DeleteViaIdentityNamespace', Mandatory)] - [Alias('PolicyName')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Path')] - [System.String] - # The name of the Policy tracked resource. - ${Name}, - - [Parameter(ParameterSetName='Delete', Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Path')] - [System.String] - # The name of the namespace. - ${NamespaceName}, - - [Parameter(ParameterSetName='Delete', Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Path')] - [System.String] - # The name of the resource group. - # The name is case insensitive. - ${ResourceGroupName}, - - [Parameter(ParameterSetName='Delete')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Path')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] - [System.String] - # The ID of the target subscription. - # The value must be an UUID. - ${SubscriptionId}, - - [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Path')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IDeviceRegistryIdentity] - # Identity Parameter - ${InputObject}, - - [Parameter(ParameterSetName='DeleteViaIdentityNamespace', Mandatory, ValueFromPipeline)] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Path')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IDeviceRegistryIdentity] - # Identity Parameter - ${NamespaceInputObject}, - - [Parameter()] - [Alias('AzureRMContext', 'AzureCredential')] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category('Runtime')] - [System.Management.Automation.SwitchParameter] - # Run the command as a job - ${AsJob}, - - [Parameter(DontShow)] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Runtime')] - [System.Management.Automation.SwitchParameter] - # Wait for .NET debugger to attach - ${Break}, - - [Parameter(DontShow)] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Runtime')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SendAsyncStep[]] - # SendAsync Pipeline Steps to be appended to the front of the pipeline - ${HttpPipelineAppend}, - - [Parameter(DontShow)] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Runtime')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SendAsyncStep[]] - # SendAsync Pipeline Steps to be prepended to the front of the pipeline - ${HttpPipelinePrepend}, - - [Parameter()] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Runtime')] - [System.Management.Automation.SwitchParameter] - # Run the command asynchronously - ${NoWait}, - - [Parameter()] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Runtime')] - [System.Management.Automation.SwitchParameter] - # Returns true when the command succeeds - ${PassThru}, - - [Parameter(DontShow)] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Runtime')] - [System.Uri] - # The URI for the proxy server to use - ${Proxy}, - - [Parameter(DontShow)] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Runtime')] - [System.Management.Automation.PSCredential] - # Credentials for a proxy server to use for the remote call - ${ProxyCredential}, - - [Parameter(DontShow)] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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 - - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } - - $context = Get-AzContext - if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit - } - - if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() - } - $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId - if ($preTelemetryId -eq '') { - [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.private\Remove-AzDeviceRegistryPolicy_Delete'; - DeleteViaIdentity = 'Az.DeviceRegistry.private\Remove-AzDeviceRegistryPolicy_DeleteViaIdentity'; - DeleteViaIdentityNamespace = 'Az.DeviceRegistry.private\Remove-AzDeviceRegistryPolicy_DeleteViaIdentityNamespace'; - } - if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { - 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.DeviceRegistry.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.DeviceRegistry.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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) - if ($wrappedCmd -eq $null) { - $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) - } - $scriptCmd = {& $wrappedCmd @PSBoundParameters} - $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) - $steppablePipeline.Begin($PSCmdlet) - } 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.DeviceRegistry.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/DeviceRegistry/DeviceRegistry.Autorest/exports/Remove-AzDeviceRegistrySchema.ps1 b/generated/DeviceRegistry/DeviceRegistry.Autorest/exports/Remove-AzDeviceRegistrySchema.ps1 index 73aed42ece2a..162cbfe779ce 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/exports/Remove-AzDeviceRegistrySchema.ps1 +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/exports/Remove-AzDeviceRegistrySchema.ps1 @@ -52,7 +52,6 @@ INPUTOBJECT : Identity Parameter [Location ]: The name of the Azure region. [NamespaceName ]: The name of the namespace. [OperationId ]: The ID of an ongoing async operation. - [PolicyName ]: The name of the Policy tracked resource. [ResourceGroupName ]: The name of the resource group. The name is case insensitive. [SchemaName ]: Schema name parameter. [SchemaRegistryName ]: Schema registry name parameter. @@ -70,7 +69,6 @@ SCHEMAREGISTRYINPUTOBJECT : Identity Parameter [Location ]: The name of the Azure region. [NamespaceName ]: The name of the namespace. [OperationId ]: The ID of an ongoing async operation. - [PolicyName ]: The name of the Policy tracked resource. [ResourceGroupName ]: The name of the resource group. The name is case insensitive. [SchemaName ]: Schema name parameter. [SchemaRegistryName ]: Schema registry name parameter. diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/exports/Remove-AzDeviceRegistrySchemaRegistry.ps1 b/generated/DeviceRegistry/DeviceRegistry.Autorest/exports/Remove-AzDeviceRegistrySchemaRegistry.ps1 index 129fefceb2f6..f88dc5268ddc 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/exports/Remove-AzDeviceRegistrySchemaRegistry.ps1 +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/exports/Remove-AzDeviceRegistrySchemaRegistry.ps1 @@ -45,7 +45,6 @@ INPUTOBJECT : Identity Parameter [Location ]: The name of the Azure region. [NamespaceName ]: The name of the namespace. [OperationId ]: The ID of an ongoing async operation. - [PolicyName ]: The name of the Policy tracked resource. [ResourceGroupName ]: The name of the resource group. The name is case insensitive. [SchemaName ]: Schema name parameter. [SchemaRegistryName ]: Schema registry name parameter. diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/exports/Remove-AzDeviceRegistrySchemaVersion.ps1 b/generated/DeviceRegistry/DeviceRegistry.Autorest/exports/Remove-AzDeviceRegistrySchemaVersion.ps1 index e86c9ffa7660..010c68f7ab84 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/exports/Remove-AzDeviceRegistrySchemaVersion.ps1 +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/exports/Remove-AzDeviceRegistrySchemaVersion.ps1 @@ -51,7 +51,6 @@ INPUTOBJECT : Identity Parameter [Location ]: The name of the Azure region. [NamespaceName ]: The name of the namespace. [OperationId ]: The ID of an ongoing async operation. - [PolicyName ]: The name of the Policy tracked resource. [ResourceGroupName ]: The name of the resource group. The name is case insensitive. [SchemaName ]: Schema name parameter. [SchemaRegistryName ]: Schema registry name parameter. @@ -69,7 +68,6 @@ SCHEMAINPUTOBJECT : Identity Parameter [Location ]: The name of the Azure region. [NamespaceName ]: The name of the namespace. [OperationId ]: The ID of an ongoing async operation. - [PolicyName ]: The name of the Policy tracked resource. [ResourceGroupName ]: The name of the resource group. The name is case insensitive. [SchemaName ]: Schema name parameter. [SchemaRegistryName ]: Schema registry name parameter. @@ -87,7 +85,6 @@ SCHEMAREGISTRYINPUTOBJECT : Identity Parameter [Location ]: The name of the Azure region. [NamespaceName ]: The name of the namespace. [OperationId ]: The ID of an ongoing async operation. - [PolicyName ]: The name of the Policy tracked resource. [ResourceGroupName ]: The name of the resource group. The name is case insensitive. [SchemaName ]: Schema name parameter. [SchemaRegistryName ]: Schema registry name parameter. diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/exports/Sync-AzDeviceRegistryCredentials.ps1 b/generated/DeviceRegistry/DeviceRegistry.Autorest/exports/Sync-AzDeviceRegistryCredentials.ps1 deleted file mode 100644 index 60c42e7bd214..000000000000 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/exports/Sync-AzDeviceRegistryCredentials.ps1 +++ /dev/null @@ -1,252 +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 -A long-running resource action. -.Description -A long-running resource action. -.Example -Sync-AzDeviceRegistryCredentials -NamespaceName my-namespace -ResourceGroupName my-resource-group -.Example -Sync-AzDeviceRegistryCredentials -NamespaceName my-namespace -ResourceGroupName my-resource-group -Verbose -.Example -Get-AzDeviceRegistryCredentials -NamespaceName my-namespace -ResourceGroupName my-resource-group | Sync-AzDeviceRegistryCredentials - -.Inputs -Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IDeviceRegistryIdentity -.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 - [AssetEndpointProfileName ]: Asset Endpoint Profile name parameter. - [AssetName ]: Asset name parameter. - [BillingContainerName ]: Name of the billing container. - [DeviceName ]: The name of the device. - [DiscoveredAssetName ]: The name of the discovered asset. - [DiscoveredDeviceName ]: The name of the discovered device. - [Id ]: Resource identity path - [Location ]: The name of the Azure region. - [NamespaceName ]: The name of the namespace. - [OperationId ]: The ID of an ongoing async operation. - [PolicyName ]: The name of the Policy tracked resource. - [ResourceGroupName ]: The name of the resource group. The name is case insensitive. - [SchemaName ]: Schema name parameter. - [SchemaRegistryName ]: Schema registry name parameter. - [SchemaVersionName ]: Schema version name parameter. - [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. -.Link -https://learn.microsoft.com/powershell/module/az.deviceregistry/sync-azdeviceregistrycredentials -#> -function Sync-AzDeviceRegistryCredentials { -[OutputType([System.Boolean])] -[CmdletBinding(DefaultParameterSetName='Synchronize', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] -param( - [Parameter(ParameterSetName='Synchronize', Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Path')] - [System.String] - # The name of the namespace. - ${NamespaceName}, - - [Parameter(ParameterSetName='Synchronize', Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Path')] - [System.String] - # The name of the resource group. - # The name is case insensitive. - ${ResourceGroupName}, - - [Parameter(ParameterSetName='Synchronize')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Path')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] - [System.String] - # The ID of the target subscription. - # The value must be an UUID. - ${SubscriptionId}, - - [Parameter(ParameterSetName='SynchronizeViaIdentity', Mandatory, ValueFromPipeline)] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Path')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IDeviceRegistryIdentity] - # Identity Parameter - ${InputObject}, - - [Parameter()] - [Alias('AzureRMContext', 'AzureCredential')] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category('Runtime')] - [System.Management.Automation.SwitchParameter] - # Run the command as a job - ${AsJob}, - - [Parameter(DontShow)] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Runtime')] - [System.Management.Automation.SwitchParameter] - # Wait for .NET debugger to attach - ${Break}, - - [Parameter(DontShow)] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Runtime')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SendAsyncStep[]] - # SendAsync Pipeline Steps to be appended to the front of the pipeline - ${HttpPipelineAppend}, - - [Parameter(DontShow)] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Runtime')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SendAsyncStep[]] - # SendAsync Pipeline Steps to be prepended to the front of the pipeline - ${HttpPipelinePrepend}, - - [Parameter()] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Runtime')] - [System.Management.Automation.SwitchParameter] - # Run the command asynchronously - ${NoWait}, - - [Parameter()] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Runtime')] - [System.Management.Automation.SwitchParameter] - # Returns true when the command succeeds - ${PassThru}, - - [Parameter(DontShow)] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Runtime')] - [System.Uri] - # The URI for the proxy server to use - ${Proxy}, - - [Parameter(DontShow)] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Runtime')] - [System.Management.Automation.PSCredential] - # Credentials for a proxy server to use for the remote call - ${ProxyCredential}, - - [Parameter(DontShow)] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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 - - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } - - $context = Get-AzContext - if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit - } - - if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() - } - $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId - if ($preTelemetryId -eq '') { - [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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 = @{ - Synchronize = 'Az.DeviceRegistry.private\Sync-AzDeviceRegistryCredentials_Synchronize'; - SynchronizeViaIdentity = 'Az.DeviceRegistry.private\Sync-AzDeviceRegistryCredentials_SynchronizeViaIdentity'; - } - if (('Synchronize') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { - 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.DeviceRegistry.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.DeviceRegistry.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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) - if ($wrappedCmd -eq $null) { - $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) - } - $scriptCmd = {& $wrappedCmd @PSBoundParameters} - $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) - $steppablePipeline.Begin($PSCmdlet) - } 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.DeviceRegistry.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/DeviceRegistry/DeviceRegistry.Autorest/exports/Update-AzDeviceRegistryAsset.ps1 b/generated/DeviceRegistry/DeviceRegistry.Autorest/exports/Update-AzDeviceRegistryAsset.ps1 index a6c532e4dbb8..f5c3cb4c6597 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/exports/Update-AzDeviceRegistryAsset.ps1 +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/exports/Update-AzDeviceRegistryAsset.ps1 @@ -70,7 +70,6 @@ INPUTOBJECT : Identity Parameter [Location ]: The name of the Azure region. [NamespaceName ]: The name of the namespace. [OperationId ]: The ID of an ongoing async operation. - [PolicyName ]: The name of the Policy tracked resource. [ResourceGroupName ]: The name of the resource group. The name is case insensitive. [SchemaName ]: Schema name parameter. [SchemaRegistryName ]: Schema registry name parameter. diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/exports/Update-AzDeviceRegistryAssetEndpointProfile.ps1 b/generated/DeviceRegistry/DeviceRegistry.Autorest/exports/Update-AzDeviceRegistryAssetEndpointProfile.ps1 index 34c3dbc45481..6eb6bb8738ec 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/exports/Update-AzDeviceRegistryAssetEndpointProfile.ps1 +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/exports/Update-AzDeviceRegistryAssetEndpointProfile.ps1 @@ -54,7 +54,6 @@ INPUTOBJECT : Identity Parameter [Location ]: The name of the Azure region. [NamespaceName ]: The name of the namespace. [OperationId ]: The ID of an ongoing async operation. - [PolicyName ]: The name of the Policy tracked resource. [ResourceGroupName ]: The name of the resource group. The name is case insensitive. [SchemaName ]: Schema name parameter. [SchemaRegistryName ]: Schema registry name parameter. diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/exports/Update-AzDeviceRegistryCredentials.ps1 b/generated/DeviceRegistry/DeviceRegistry.Autorest/exports/Update-AzDeviceRegistryCredentials.ps1 deleted file mode 100644 index 95e623bda7e4..000000000000 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/exports/Update-AzDeviceRegistryCredentials.ps1 +++ /dev/null @@ -1,291 +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 -Update a Credential -.Description -Update a Credential -.Example -Update-AzDeviceRegistryCredentials -NamespaceName my-namespace -ResourceGroupName my-resource-group -Tag @{"environment" = "production"; "team" = "iot"; "updated" = "true"} -.Example -$credentialsIdentity = @{ - SubscriptionId = "xxxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx" - ResourceGroupName = "my-resource-group" - NamespaceName = "my-namespace" -} -Update-AzDeviceRegistryCredentials -InputObject $credentialsIdentity -Tag @{"environment" = "staging"; "team" = "iot"} -.Example -Update-AzDeviceRegistryCredentials -NamespaceName my-namespace -ResourceGroupName my-resource-group -JsonFilePath "C:\credentials\update.json" -.Example -$jsonString = @" -{ - "tags": { - "environment": "production", - "team": "iot", - "version": "2.0" - } -} -"@ - -Update-AzDeviceRegistryCredentials -NamespaceName my-namespace -ResourceGroupName my-resource-group -JsonString $jsonString - -.Inputs -Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IDeviceRegistryIdentity -.Outputs -Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICredential -.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 - [AssetEndpointProfileName ]: Asset Endpoint Profile name parameter. - [AssetName ]: Asset name parameter. - [BillingContainerName ]: Name of the billing container. - [DeviceName ]: The name of the device. - [DiscoveredAssetName ]: The name of the discovered asset. - [DiscoveredDeviceName ]: The name of the discovered device. - [Id ]: Resource identity path - [Location ]: The name of the Azure region. - [NamespaceName ]: The name of the namespace. - [OperationId ]: The ID of an ongoing async operation. - [PolicyName ]: The name of the Policy tracked resource. - [ResourceGroupName ]: The name of the resource group. The name is case insensitive. - [SchemaName ]: Schema name parameter. - [SchemaRegistryName ]: Schema registry name parameter. - [SchemaVersionName ]: Schema version name parameter. - [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. -.Link -https://learn.microsoft.com/powershell/module/az.deviceregistry/update-azdeviceregistrycredentials -#> -function Update-AzDeviceRegistryCredentials { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICredential])] -[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] -param( - [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] - [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] - [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Path')] - [System.String] - # The name of the namespace. - ${NamespaceName}, - - [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] - [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] - [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Path')] - [System.String] - # The name of the resource group. - # The name is case insensitive. - ${ResourceGroupName}, - - [Parameter(ParameterSetName='UpdateExpanded')] - [Parameter(ParameterSetName='UpdateViaJsonFilePath')] - [Parameter(ParameterSetName='UpdateViaJsonString')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Path')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] - [System.String] - # The ID of the target subscription. - # The value must be an UUID. - ${SubscriptionId}, - - [Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory, ValueFromPipeline)] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Path')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IDeviceRegistryIdentity] - # Identity Parameter - ${InputObject}, - - [Parameter(ParameterSetName='UpdateExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICredentialUpdateTags]))] - [System.Collections.Hashtable] - # Resource tags. - ${Tag}, - - [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] - [System.String] - # Path of Json file supplied to the Update operation - ${JsonFilePath}, - - [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] - [System.String] - # Json string supplied to the Update operation - ${JsonString}, - - [Parameter()] - [Alias('AzureRMContext', 'AzureCredential')] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category('Runtime')] - [System.Management.Automation.SwitchParameter] - # Run the command as a job - ${AsJob}, - - [Parameter(DontShow)] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Runtime')] - [System.Management.Automation.SwitchParameter] - # Wait for .NET debugger to attach - ${Break}, - - [Parameter(DontShow)] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Runtime')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SendAsyncStep[]] - # SendAsync Pipeline Steps to be appended to the front of the pipeline - ${HttpPipelineAppend}, - - [Parameter(DontShow)] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Runtime')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SendAsyncStep[]] - # SendAsync Pipeline Steps to be prepended to the front of the pipeline - ${HttpPipelinePrepend}, - - [Parameter()] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Runtime')] - [System.Management.Automation.SwitchParameter] - # Run the command asynchronously - ${NoWait}, - - [Parameter(DontShow)] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Runtime')] - [System.Uri] - # The URI for the proxy server to use - ${Proxy}, - - [Parameter(DontShow)] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Runtime')] - [System.Management.Automation.PSCredential] - # Credentials for a proxy server to use for the remote call - ${ProxyCredential}, - - [Parameter(DontShow)] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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 - - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } - - $context = Get-AzContext - if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit - } - - if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() - } - $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId - if ($preTelemetryId -eq '') { - [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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 = @{ - UpdateExpanded = 'Az.DeviceRegistry.private\Update-AzDeviceRegistryCredentials_UpdateExpanded'; - UpdateViaIdentityExpanded = 'Az.DeviceRegistry.private\Update-AzDeviceRegistryCredentials_UpdateViaIdentityExpanded'; - UpdateViaJsonFilePath = 'Az.DeviceRegistry.private\Update-AzDeviceRegistryCredentials_UpdateViaJsonFilePath'; - UpdateViaJsonString = 'Az.DeviceRegistry.private\Update-AzDeviceRegistryCredentials_UpdateViaJsonString'; - } - if (('UpdateExpanded', 'UpdateViaJsonFilePath', 'UpdateViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { - 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.DeviceRegistry.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.DeviceRegistry.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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) - if ($wrappedCmd -eq $null) { - $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) - } - $scriptCmd = {& $wrappedCmd @PSBoundParameters} - $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) - $steppablePipeline.Begin($PSCmdlet) - } 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.DeviceRegistry.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/DeviceRegistry/DeviceRegistry.Autorest/exports/Update-AzDeviceRegistryNamespace.ps1 b/generated/DeviceRegistry/DeviceRegistry.Autorest/exports/Update-AzDeviceRegistryNamespace.ps1 index 98ec414ddaf0..262386039808 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/exports/Update-AzDeviceRegistryNamespace.ps1 +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/exports/Update-AzDeviceRegistryNamespace.ps1 @@ -58,7 +58,6 @@ INPUTOBJECT : Identity Parameter [Location ]: The name of the Azure region. [NamespaceName ]: The name of the namespace. [OperationId ]: The ID of an ongoing async operation. - [PolicyName ]: The name of the Policy tracked resource. [ResourceGroupName ]: The name of the resource group. The name is case insensitive. [SchemaName ]: Schema name parameter. [SchemaRegistryName ]: Schema registry name parameter. diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/exports/Update-AzDeviceRegistryNamespaceAsset.ps1 b/generated/DeviceRegistry/DeviceRegistry.Autorest/exports/Update-AzDeviceRegistryNamespaceAsset.ps1 index 1b3f10a9a763..19644dc133aa 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/exports/Update-AzDeviceRegistryNamespaceAsset.ps1 +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/exports/Update-AzDeviceRegistryNamespaceAsset.ps1 @@ -97,7 +97,6 @@ INPUTOBJECT : Identity Parameter [Location ]: The name of the Azure region. [NamespaceName ]: The name of the namespace. [OperationId ]: The ID of an ongoing async operation. - [PolicyName ]: The name of the Policy tracked resource. [ResourceGroupName ]: The name of the resource group. The name is case insensitive. [SchemaName ]: Schema name parameter. [SchemaRegistryName ]: Schema registry name parameter. @@ -131,7 +130,6 @@ NAMESPACEINPUTOBJECT : Identity Parameter [Location ]: The name of the Azure region. [NamespaceName ]: The name of the namespace. [OperationId ]: The ID of an ongoing async operation. - [PolicyName ]: The name of the Policy tracked resource. [ResourceGroupName ]: The name of the resource group. The name is case insensitive. [SchemaName ]: Schema name parameter. [SchemaRegistryName ]: Schema registry name parameter. diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/exports/Update-AzDeviceRegistryNamespaceDevice.ps1 b/generated/DeviceRegistry/DeviceRegistry.Autorest/exports/Update-AzDeviceRegistryNamespaceDevice.ps1 index 6106464593e8..19074aa0ee7a 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/exports/Update-AzDeviceRegistryNamespaceDevice.ps1 +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/exports/Update-AzDeviceRegistryNamespaceDevice.ps1 @@ -91,20 +91,6 @@ $endpointsInbound = @{ } Update-AzDeviceRegistryNamespaceDevice -NamespaceInputObject $namespaceIdentity -DeviceName "my-device" -OperatingSystemVersion "10.0.19041" -EndpointInbound $endpointsInbound .Example -# Define the device identifiers -$SubscriptionId = (Get-AzContext).Subscription.Id -$ResourceGroupName = "my-resource-group" -$NamespaceName = "my-namespace" -$DeviceName = "my-device" - -# Create a device identity object -$deviceIdentity = @{ - SubscriptionId = $SubscriptionId - ResourceGroupName = $ResourceGroupName - NamespaceName = $NamespaceName - DeviceName = $DeviceName -} - $endpointsInbound = @{ "endpoint1" = @{ Address = "https://my-inbound-endpoint1.westeurope-1.iothub.azure.net" @@ -120,8 +106,7 @@ $endpointsInbound = @{ UsernamePasswordCredentialsPasswordSecretName = "my-password-secret" } } - -Update-AzDeviceRegistryNamespaceDevice -InputObject $deviceIdentity -OperatingSystemVersion "10.0.19041" -EndpointInbound $endpointsInbound +Update-AzDeviceRegistryNamespaceDevice -InputObject $deviceObject -OperatingSystemVersion "10.0.19041" -EndpointInbound $endpointsInbound .Inputs Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IDeviceRegistryIdentity @@ -143,7 +128,6 @@ INPUTOBJECT : Identity Parameter [Location ]: The name of the Azure region. [NamespaceName ]: The name of the namespace. [OperationId ]: The ID of an ongoing async operation. - [PolicyName ]: The name of the Policy tracked resource. [ResourceGroupName ]: The name of the resource group. The name is case insensitive. [SchemaName ]: Schema name parameter. [SchemaRegistryName ]: Schema registry name parameter. @@ -161,7 +145,6 @@ NAMESPACEINPUTOBJECT : Identity Parameter [Location ]: The name of the Azure region. [NamespaceName ]: The name of the namespace. [OperationId ]: The ID of an ongoing async operation. - [PolicyName ]: The name of the Policy tracked resource. [ResourceGroupName ]: The name of the resource group. The name is case insensitive. [SchemaName ]: Schema name parameter. [SchemaRegistryName ]: Schema registry name parameter. @@ -275,14 +258,6 @@ param( # Set of most recently removed endpoints. ${OutboundUnassigned}, - [Parameter(ParameterSetName='UpdateExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityNamespaceExpanded')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] - [System.String] - # Resource Id of the Policy. - ${PolicyResourceId}, - [Parameter(ParameterSetName='UpdateExpanded')] [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Parameter(ParameterSetName='UpdateViaIdentityNamespaceExpanded')] diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/exports/Update-AzDeviceRegistryNamespaceDiscoveredAsset.ps1 b/generated/DeviceRegistry/DeviceRegistry.Autorest/exports/Update-AzDeviceRegistryNamespaceDiscoveredAsset.ps1 index 9fb53e85ee34..587145b6936a 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/exports/Update-AzDeviceRegistryNamespaceDiscoveredAsset.ps1 +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/exports/Update-AzDeviceRegistryNamespaceDiscoveredAsset.ps1 @@ -100,7 +100,6 @@ INPUTOBJECT : Identity Parameter [Location ]: The name of the Azure region. [NamespaceName ]: The name of the namespace. [OperationId ]: The ID of an ongoing async operation. - [PolicyName ]: The name of the Policy tracked resource. [ResourceGroupName ]: The name of the resource group. The name is case insensitive. [SchemaName ]: Schema name parameter. [SchemaRegistryName ]: Schema registry name parameter. @@ -136,7 +135,6 @@ NAMESPACEINPUTOBJECT : Identity Parameter [Location ]: The name of the Azure region. [NamespaceName ]: The name of the namespace. [OperationId ]: The ID of an ongoing async operation. - [PolicyName ]: The name of the Policy tracked resource. [ResourceGroupName ]: The name of the resource group. The name is case insensitive. [SchemaName ]: Schema name parameter. [SchemaRegistryName ]: Schema registry name parameter. diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/exports/Update-AzDeviceRegistryNamespaceDiscoveredDevice.ps1 b/generated/DeviceRegistry/DeviceRegistry.Autorest/exports/Update-AzDeviceRegistryNamespaceDiscoveredDevice.ps1 index d68b970d0bd0..d743095631c5 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/exports/Update-AzDeviceRegistryNamespaceDiscoveredDevice.ps1 +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/exports/Update-AzDeviceRegistryNamespaceDiscoveredDevice.ps1 @@ -128,7 +128,6 @@ INPUTOBJECT : Identity Parameter [Location ]: The name of the Azure region. [NamespaceName ]: The name of the namespace. [OperationId ]: The ID of an ongoing async operation. - [PolicyName ]: The name of the Policy tracked resource. [ResourceGroupName ]: The name of the resource group. The name is case insensitive. [SchemaName ]: Schema name parameter. [SchemaRegistryName ]: Schema registry name parameter. @@ -146,7 +145,6 @@ NAMESPACEINPUTOBJECT : Identity Parameter [Location ]: The name of the Azure region. [NamespaceName ]: The name of the namespace. [OperationId ]: The ID of an ongoing async operation. - [PolicyName ]: The name of the Policy tracked resource. [ResourceGroupName ]: The name of the resource group. The name is case insensitive. [SchemaName ]: Schema name parameter. [SchemaRegistryName ]: Schema registry name parameter. diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/exports/Update-AzDeviceRegistryPolicy.ps1 b/generated/DeviceRegistry/DeviceRegistry.Autorest/exports/Update-AzDeviceRegistryPolicy.ps1 deleted file mode 100644 index b4593b3f6977..000000000000 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/exports/Update-AzDeviceRegistryPolicy.ps1 +++ /dev/null @@ -1,358 +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 -Update a Policy -.Description -Update a Policy -.Example -$jsonString = @" -{ - "properties": { - "certificate": { - "leafCertificateConfiguration": { - "validityPeriodInDays": 60 - } - } - } -} -"@ - -Update-AzDeviceRegistryPolicy -Name my-policy -NamespaceName my-namespace -ResourceGroupName my-resource-group -JsonString $jsonString -.Example -$jsonString = @" -{ - "tags": { - "environment": "production", - "team": "iot", - "updated": "true" - } -} -"@ - -Update-AzDeviceRegistryPolicy -Name my-policy -NamespaceName my-namespace -ResourceGroupName my-resource-group -JsonString $jsonString -.Example -Update-AzDeviceRegistryPolicy -Name my-policy -NamespaceName my-namespace -ResourceGroupName my-resource-group -JsonFilePath "C:\policies\policy-update.json" -.Example -$policyIdentity = @{ - SubscriptionId = "xxxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx" - ResourceGroupName = "my-resource-group" - NamespaceName = "my-namespace" - CredentialName = "default" - PolicyName = "my-policy-name" -} - -Update-AzDeviceRegistryPolicy -InputObject $policyIdentity -Tag @{"environment" = "staging"} - -.Inputs -Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IDeviceRegistryIdentity -.Outputs -Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicy -.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 - [AssetEndpointProfileName ]: Asset Endpoint Profile name parameter. - [AssetName ]: Asset name parameter. - [BillingContainerName ]: Name of the billing container. - [DeviceName ]: The name of the device. - [DiscoveredAssetName ]: The name of the discovered asset. - [DiscoveredDeviceName ]: The name of the discovered device. - [Id ]: Resource identity path - [Location ]: The name of the Azure region. - [NamespaceName ]: The name of the namespace. - [OperationId ]: The ID of an ongoing async operation. - [PolicyName ]: The name of the Policy tracked resource. - [ResourceGroupName ]: The name of the resource group. The name is case insensitive. - [SchemaName ]: Schema name parameter. - [SchemaRegistryName ]: Schema registry name parameter. - [SchemaVersionName ]: Schema version name parameter. - [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. - -NAMESPACEINPUTOBJECT : Identity Parameter - [AssetEndpointProfileName ]: Asset Endpoint Profile name parameter. - [AssetName ]: Asset name parameter. - [BillingContainerName ]: Name of the billing container. - [DeviceName ]: The name of the device. - [DiscoveredAssetName ]: The name of the discovered asset. - [DiscoveredDeviceName ]: The name of the discovered device. - [Id ]: Resource identity path - [Location ]: The name of the Azure region. - [NamespaceName ]: The name of the namespace. - [OperationId ]: The ID of an ongoing async operation. - [PolicyName ]: The name of the Policy tracked resource. - [ResourceGroupName ]: The name of the resource group. The name is case insensitive. - [SchemaName ]: Schema name parameter. - [SchemaRegistryName ]: Schema registry name parameter. - [SchemaVersionName ]: Schema version name parameter. - [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. -.Link -https://learn.microsoft.com/powershell/module/az.deviceregistry/update-azdeviceregistrypolicy -#> -function Update-AzDeviceRegistryPolicy { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicy])] -[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] -param( - [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] - [Parameter(ParameterSetName='UpdateViaIdentityNamespaceExpanded', Mandatory)] - [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] - [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] - [Alias('PolicyName')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Path')] - [System.String] - # The name of the Policy tracked resource. - ${Name}, - - [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] - [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] - [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Path')] - [System.String] - # The name of the namespace. - ${NamespaceName}, - - [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] - [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] - [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Path')] - [System.String] - # The name of the resource group. - # The name is case insensitive. - ${ResourceGroupName}, - - [Parameter(ParameterSetName='UpdateExpanded')] - [Parameter(ParameterSetName='UpdateViaJsonFilePath')] - [Parameter(ParameterSetName='UpdateViaJsonString')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Path')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] - [System.String] - # The ID of the target subscription. - # The value must be an UUID. - ${SubscriptionId}, - - [Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory, ValueFromPipeline)] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Path')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IDeviceRegistryIdentity] - # Identity Parameter - ${InputObject}, - - [Parameter(ParameterSetName='UpdateViaIdentityNamespaceExpanded', Mandatory, ValueFromPipeline)] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Path')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IDeviceRegistryIdentity] - # Identity Parameter - ${NamespaceInputObject}, - - [Parameter(ParameterSetName='UpdateExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityNamespaceExpanded')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAny] - # The configuration to set up an ICA. - ${CertificateAuthorityConfiguration}, - - [Parameter(ParameterSetName='UpdateExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityNamespaceExpanded')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] - [System.Int32] - # The validity period in days. - ${LeafCertificateConfigurationValidityPeriodInDay}, - - [Parameter(ParameterSetName='UpdateExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityNamespaceExpanded')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyUpdateTags]))] - [System.Collections.Hashtable] - # Resource tags. - ${Tag}, - - [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] - [System.String] - # Path of Json file supplied to the Update operation - ${JsonFilePath}, - - [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Body')] - [System.String] - # Json string supplied to the Update operation - ${JsonString}, - - [Parameter()] - [Alias('AzureRMContext', 'AzureCredential')] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category('Runtime')] - [System.Management.Automation.SwitchParameter] - # Run the command as a job - ${AsJob}, - - [Parameter(DontShow)] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Runtime')] - [System.Management.Automation.SwitchParameter] - # Wait for .NET debugger to attach - ${Break}, - - [Parameter(DontShow)] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Runtime')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SendAsyncStep[]] - # SendAsync Pipeline Steps to be appended to the front of the pipeline - ${HttpPipelineAppend}, - - [Parameter(DontShow)] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Runtime')] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SendAsyncStep[]] - # SendAsync Pipeline Steps to be prepended to the front of the pipeline - ${HttpPipelinePrepend}, - - [Parameter()] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Runtime')] - [System.Management.Automation.SwitchParameter] - # Run the command asynchronously - ${NoWait}, - - [Parameter(DontShow)] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Runtime')] - [System.Uri] - # The URI for the proxy server to use - ${Proxy}, - - [Parameter(DontShow)] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category('Runtime')] - [System.Management.Automation.PSCredential] - # Credentials for a proxy server to use for the remote call - ${ProxyCredential}, - - [Parameter(DontShow)] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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 - - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } - - $context = Get-AzContext - if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit - } - - if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() - } - $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId - if ($preTelemetryId -eq '') { - [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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 = @{ - UpdateExpanded = 'Az.DeviceRegistry.private\Update-AzDeviceRegistryPolicy_UpdateExpanded'; - UpdateViaIdentityExpanded = 'Az.DeviceRegistry.private\Update-AzDeviceRegistryPolicy_UpdateViaIdentityExpanded'; - UpdateViaIdentityNamespaceExpanded = 'Az.DeviceRegistry.private\Update-AzDeviceRegistryPolicy_UpdateViaIdentityNamespaceExpanded'; - UpdateViaJsonFilePath = 'Az.DeviceRegistry.private\Update-AzDeviceRegistryPolicy_UpdateViaJsonFilePath'; - UpdateViaJsonString = 'Az.DeviceRegistry.private\Update-AzDeviceRegistryPolicy_UpdateViaJsonString'; - } - if (('UpdateExpanded', 'UpdateViaJsonFilePath', 'UpdateViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { - 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.DeviceRegistry.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.DeviceRegistry.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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) - if ($wrappedCmd -eq $null) { - $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) - } - $scriptCmd = {& $wrappedCmd @PSBoundParameters} - $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) - $steppablePipeline.Begin($PSCmdlet) - } 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.DeviceRegistry.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/DeviceRegistry/DeviceRegistry.Autorest/exports/Update-AzDeviceRegistrySchema.ps1 b/generated/DeviceRegistry/DeviceRegistry.Autorest/exports/Update-AzDeviceRegistrySchema.ps1 index 58c3da979d60..19703582020d 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/exports/Update-AzDeviceRegistrySchema.ps1 +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/exports/Update-AzDeviceRegistrySchema.ps1 @@ -51,7 +51,6 @@ INPUTOBJECT : Identity Parameter [Location ]: The name of the Azure region. [NamespaceName ]: The name of the namespace. [OperationId ]: The ID of an ongoing async operation. - [PolicyName ]: The name of the Policy tracked resource. [ResourceGroupName ]: The name of the resource group. The name is case insensitive. [SchemaName ]: Schema name parameter. [SchemaRegistryName ]: Schema registry name parameter. @@ -69,7 +68,6 @@ SCHEMAREGISTRYINPUTOBJECT : Identity Parameter [Location ]: The name of the Azure region. [NamespaceName ]: The name of the namespace. [OperationId ]: The ID of an ongoing async operation. - [PolicyName ]: The name of the Policy tracked resource. [ResourceGroupName ]: The name of the resource group. The name is case insensitive. [SchemaName ]: Schema name parameter. [SchemaRegistryName ]: Schema registry name parameter. diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/exports/Update-AzDeviceRegistrySchemaRegistry.ps1 b/generated/DeviceRegistry/DeviceRegistry.Autorest/exports/Update-AzDeviceRegistrySchemaRegistry.ps1 index f2016172f132..0a9c54f0ec70 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/exports/Update-AzDeviceRegistrySchemaRegistry.ps1 +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/exports/Update-AzDeviceRegistrySchemaRegistry.ps1 @@ -49,7 +49,6 @@ INPUTOBJECT : Identity Parameter [Location ]: The name of the Azure region. [NamespaceName ]: The name of the namespace. [OperationId ]: The ID of an ongoing async operation. - [PolicyName ]: The name of the Policy tracked resource. [ResourceGroupName ]: The name of the resource group. The name is case insensitive. [SchemaName ]: Schema name parameter. [SchemaRegistryName ]: Schema registry name parameter. diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/exports/Update-AzDeviceRegistrySchemaVersion.ps1 b/generated/DeviceRegistry/DeviceRegistry.Autorest/exports/Update-AzDeviceRegistrySchemaVersion.ps1 index 104707d8374c..f7f78c8fd8f9 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/exports/Update-AzDeviceRegistrySchemaVersion.ps1 +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/exports/Update-AzDeviceRegistrySchemaVersion.ps1 @@ -50,7 +50,6 @@ INPUTOBJECT : Identity Parameter [Location ]: The name of the Azure region. [NamespaceName ]: The name of the namespace. [OperationId ]: The ID of an ongoing async operation. - [PolicyName ]: The name of the Policy tracked resource. [ResourceGroupName ]: The name of the resource group. The name is case insensitive. [SchemaName ]: Schema name parameter. [SchemaRegistryName ]: Schema registry name parameter. @@ -68,7 +67,6 @@ SCHEMAINPUTOBJECT : Identity Parameter [Location ]: The name of the Azure region. [NamespaceName ]: The name of the namespace. [OperationId ]: The ID of an ongoing async operation. - [PolicyName ]: The name of the Policy tracked resource. [ResourceGroupName ]: The name of the resource group. The name is case insensitive. [SchemaName ]: Schema name parameter. [SchemaRegistryName ]: Schema registry name parameter. @@ -86,7 +84,6 @@ SCHEMAREGISTRYINPUTOBJECT : Identity Parameter [Location ]: The name of the Azure region. [NamespaceName ]: The name of the namespace. [OperationId ]: The ID of an ongoing async operation. - [PolicyName ]: The name of the Policy tracked resource. [ResourceGroupName ]: The name of the resource group. The name is case insensitive. [SchemaName ]: Schema name parameter. [SchemaRegistryName ]: Schema registry name parameter. diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generate-info.json b/generated/DeviceRegistry/DeviceRegistry.Autorest/generate-info.json index fb58904facc7..442121f3f16c 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generate-info.json +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/generate-info.json @@ -1,3 +1,3 @@ { - "generate_Id": "544c4734-d12c-46b3-9bd2-e472858cb9a0" + "generate_Id": "cbbc2426-6ad9-42be-8c66-b09cd9cb8cbc" } diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/DeviceRegistry.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/DeviceRegistry.cs index f47c21b1443c..2a173f442d58 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/DeviceRegistry.cs +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/DeviceRegistry.cs @@ -30,7 +30,7 @@ public partial class DeviceRegistry /// public async global::System.Threading.Tasks.Task AssetEndpointProfilesCreateOrReplace(string subscriptionId, string resourceGroupName, string assetEndpointProfileName, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetEndpointProfile body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -77,7 +77,7 @@ public partial class DeviceRegistry /// public async global::System.Threading.Tasks.Task AssetEndpointProfilesCreateOrReplaceViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetEndpointProfile body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -134,7 +134,7 @@ public partial class DeviceRegistry /// public async global::System.Threading.Tasks.Task AssetEndpointProfilesCreateOrReplaceViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetEndpointProfile body, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -194,7 +194,7 @@ public partial class DeviceRegistry /// public async global::System.Threading.Tasks.Task AssetEndpointProfilesCreateOrReplaceViaJsonString(string subscriptionId, string resourceGroupName, string assetEndpointProfileName, 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.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -240,7 +240,7 @@ public partial class DeviceRegistry /// public async global::System.Threading.Tasks.Task AssetEndpointProfilesCreateOrReplaceViaJsonStringWithResult(string subscriptionId, string resourceGroupName, string assetEndpointProfileName, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -287,7 +287,7 @@ public partial class DeviceRegistry /// public async global::System.Threading.Tasks.Task AssetEndpointProfilesCreateOrReplaceWithResult(string subscriptionId, string resourceGroupName, string assetEndpointProfileName, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetEndpointProfile body, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -663,7 +663,7 @@ public partial class DeviceRegistry /// public async global::System.Threading.Tasks.Task AssetEndpointProfilesDelete(string subscriptionId, string resourceGroupName, string assetEndpointProfileName, global::System.Func onNoContent, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -705,7 +705,7 @@ public partial class DeviceRegistry /// public async global::System.Threading.Tasks.Task AssetEndpointProfilesDeleteViaIdentity(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.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -937,7 +937,7 @@ public partial class DeviceRegistry /// public async global::System.Threading.Tasks.Task AssetEndpointProfilesGet(string subscriptionId, string resourceGroupName, string assetEndpointProfileName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -978,7 +978,7 @@ public partial class DeviceRegistry /// public async global::System.Threading.Tasks.Task AssetEndpointProfilesGetViaIdentity(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.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -1029,7 +1029,7 @@ public partial class DeviceRegistry /// public async global::System.Threading.Tasks.Task AssetEndpointProfilesGetViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -1082,7 +1082,7 @@ public partial class DeviceRegistry /// public async global::System.Threading.Tasks.Task AssetEndpointProfilesGetWithResult(string subscriptionId, string resourceGroupName, string assetEndpointProfileName, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -1261,7 +1261,7 @@ public partial class DeviceRegistry /// public async global::System.Threading.Tasks.Task AssetEndpointProfilesListByResourceGroup(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.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -1301,7 +1301,7 @@ public partial class DeviceRegistry /// public async global::System.Threading.Tasks.Task AssetEndpointProfilesListByResourceGroupViaIdentity(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.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -1350,7 +1350,7 @@ public partial class DeviceRegistry /// public async global::System.Threading.Tasks.Task AssetEndpointProfilesListByResourceGroupViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -1400,7 +1400,7 @@ public partial class DeviceRegistry /// public async global::System.Threading.Tasks.Task AssetEndpointProfilesListByResourceGroupWithResult(string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -1576,7 +1576,7 @@ public partial class DeviceRegistry /// public async global::System.Threading.Tasks.Task AssetEndpointProfilesListBySubscription(string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -1614,7 +1614,7 @@ public partial class DeviceRegistry /// public async global::System.Threading.Tasks.Task AssetEndpointProfilesListBySubscriptionViaIdentity(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.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -1660,7 +1660,7 @@ public partial class DeviceRegistry /// public async global::System.Threading.Tasks.Task AssetEndpointProfilesListBySubscriptionViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -1706,7 +1706,7 @@ public partial class DeviceRegistry /// public async global::System.Threading.Tasks.Task AssetEndpointProfilesListBySubscriptionWithResult(string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -1880,7 +1880,7 @@ public partial class DeviceRegistry /// public async global::System.Threading.Tasks.Task AssetEndpointProfilesUpdate(string subscriptionId, string resourceGroupName, string assetEndpointProfileName, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetEndpointProfileUpdate body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -1927,7 +1927,7 @@ public partial class DeviceRegistry /// public async global::System.Threading.Tasks.Task AssetEndpointProfilesUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetEndpointProfileUpdate body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -1984,7 +1984,7 @@ public partial class DeviceRegistry /// public async global::System.Threading.Tasks.Task AssetEndpointProfilesUpdateViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetEndpointProfileUpdate body, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -2044,7 +2044,7 @@ public partial class DeviceRegistry /// public async global::System.Threading.Tasks.Task AssetEndpointProfilesUpdateViaJsonString(string subscriptionId, string resourceGroupName, string assetEndpointProfileName, 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.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -2090,7 +2090,7 @@ public partial class DeviceRegistry /// public async global::System.Threading.Tasks.Task AssetEndpointProfilesUpdateViaJsonStringWithResult(string subscriptionId, string resourceGroupName, string assetEndpointProfileName, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -2137,7 +2137,7 @@ public partial class DeviceRegistry /// public async global::System.Threading.Tasks.Task AssetEndpointProfilesUpdateWithResult(string subscriptionId, string resourceGroupName, string assetEndpointProfileName, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetEndpointProfileUpdate body, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -2514,7 +2514,7 @@ public partial class DeviceRegistry /// public async global::System.Threading.Tasks.Task AssetsCreateOrReplace(string subscriptionId, string resourceGroupName, string assetName, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAsset body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -2561,7 +2561,7 @@ public partial class DeviceRegistry /// public async global::System.Threading.Tasks.Task AssetsCreateOrReplaceViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAsset body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -2618,7 +2618,7 @@ public partial class DeviceRegistry /// public async global::System.Threading.Tasks.Task AssetsCreateOrReplaceViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAsset body, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -2678,7 +2678,7 @@ public partial class DeviceRegistry /// public async global::System.Threading.Tasks.Task AssetsCreateOrReplaceViaJsonString(string subscriptionId, string resourceGroupName, string assetName, 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.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -2724,7 +2724,7 @@ public partial class DeviceRegistry /// public async global::System.Threading.Tasks.Task AssetsCreateOrReplaceViaJsonStringWithResult(string subscriptionId, string resourceGroupName, string assetName, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -2771,7 +2771,7 @@ public partial class DeviceRegistry /// public async global::System.Threading.Tasks.Task AssetsCreateOrReplaceWithResult(string subscriptionId, string resourceGroupName, string assetName, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAsset body, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -3143,7 +3143,7 @@ public partial class DeviceRegistry /// public async global::System.Threading.Tasks.Task AssetsDelete(string subscriptionId, string resourceGroupName, string assetName, global::System.Func onNoContent, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -3185,7 +3185,7 @@ public partial class DeviceRegistry /// public async global::System.Threading.Tasks.Task AssetsDeleteViaIdentity(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.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -3417,7 +3417,7 @@ public partial class DeviceRegistry /// public async global::System.Threading.Tasks.Task AssetsGet(string subscriptionId, string resourceGroupName, string assetName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -3458,7 +3458,7 @@ public partial class DeviceRegistry /// public async global::System.Threading.Tasks.Task AssetsGetViaIdentity(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.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -3509,7 +3509,7 @@ public partial class DeviceRegistry /// public async global::System.Threading.Tasks.Task AssetsGetViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -3562,7 +3562,7 @@ public partial class DeviceRegistry /// public async global::System.Threading.Tasks.Task AssetsGetWithResult(string subscriptionId, string resourceGroupName, string assetName, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -3741,7 +3741,7 @@ public partial class DeviceRegistry /// public async global::System.Threading.Tasks.Task AssetsListByResourceGroup(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.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -3781,7 +3781,7 @@ public partial class DeviceRegistry /// public async global::System.Threading.Tasks.Task AssetsListByResourceGroupViaIdentity(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.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -3830,7 +3830,7 @@ public partial class DeviceRegistry /// public async global::System.Threading.Tasks.Task AssetsListByResourceGroupViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -3880,7 +3880,7 @@ public partial class DeviceRegistry /// public async global::System.Threading.Tasks.Task AssetsListByResourceGroupWithResult(string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -4054,7 +4054,7 @@ public partial class DeviceRegistry /// public async global::System.Threading.Tasks.Task AssetsListBySubscription(string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -4092,7 +4092,7 @@ public partial class DeviceRegistry /// public async global::System.Threading.Tasks.Task AssetsListBySubscriptionViaIdentity(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.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -4138,7 +4138,7 @@ public partial class DeviceRegistry /// public async global::System.Threading.Tasks.Task AssetsListBySubscriptionViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -4184,7 +4184,7 @@ public partial class DeviceRegistry /// public async global::System.Threading.Tasks.Task AssetsListBySubscriptionWithResult(string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -4354,7 +4354,7 @@ public partial class DeviceRegistry /// public async global::System.Threading.Tasks.Task AssetsUpdate(string subscriptionId, string resourceGroupName, string assetName, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetUpdate body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -4401,7 +4401,7 @@ public partial class DeviceRegistry /// public async global::System.Threading.Tasks.Task AssetsUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetUpdate body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -4458,7 +4458,7 @@ public partial class DeviceRegistry /// public async global::System.Threading.Tasks.Task AssetsUpdateViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetUpdate body, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -4518,7 +4518,7 @@ public partial class DeviceRegistry /// public async global::System.Threading.Tasks.Task AssetsUpdateViaJsonString(string subscriptionId, string resourceGroupName, string assetName, 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.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -4564,7 +4564,7 @@ public partial class DeviceRegistry /// public async global::System.Threading.Tasks.Task AssetsUpdateViaJsonStringWithResult(string subscriptionId, string resourceGroupName, string assetName, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -4611,7 +4611,7 @@ public partial class DeviceRegistry /// public async global::System.Threading.Tasks.Task AssetsUpdateWithResult(string subscriptionId, string resourceGroupName, string assetName, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetUpdate body, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -4983,7 +4983,7 @@ public partial class DeviceRegistry /// public async global::System.Threading.Tasks.Task BillingContainersGet(string subscriptionId, string billingContainerName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -5022,7 +5022,7 @@ public partial class DeviceRegistry /// public async global::System.Threading.Tasks.Task BillingContainersGetViaIdentity(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.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -5070,7 +5070,7 @@ public partial class DeviceRegistry /// public async global::System.Threading.Tasks.Task BillingContainersGetViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -5119,7 +5119,7 @@ public partial class DeviceRegistry /// public async global::System.Threading.Tasks.Task BillingContainersGetWithResult(string subscriptionId, string billingContainerName, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -5291,7 +5291,7 @@ public partial class DeviceRegistry /// public async global::System.Threading.Tasks.Task BillingContainersListBySubscription(string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -5329,7 +5329,7 @@ public partial class DeviceRegistry /// public async global::System.Threading.Tasks.Task BillingContainersListBySubscriptionViaIdentity(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.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -5375,7 +5375,7 @@ public partial class DeviceRegistry /// public async global::System.Threading.Tasks.Task BillingContainersListBySubscriptionViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -5421,7 +5421,7 @@ public partial class DeviceRegistry /// public async global::System.Threading.Tasks.Task BillingContainersListBySubscriptionWithResult(string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -5579,10 +5579,11 @@ public partial class DeviceRegistry } } - /// update a Credential + /// replace a NamespaceAsset /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// The name of the namespace. + /// The name of the asset. /// Resource create parameters. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled @@ -5593,9 +5594,9 @@ public partial class DeviceRegistry /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task CredentialsCreateOrUpdate(string subscriptionId, string resourceGroupName, string namespaceName, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICredential body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeUpdate) + public async global::System.Threading.Tasks.Task NamespaceAssetsCreateOrReplace(string subscriptionId, string resourceGroupName, string namespaceName, string assetName, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceAsset body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -5607,7 +5608,8 @@ public partial class DeviceRegistry + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.DeviceRegistry/namespaces/" + global::System.Uri.EscapeDataString(namespaceName) - + "/credentials/default" + + "/assets/" + + global::System.Uri.EscapeDataString(assetName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -5625,11 +5627,11 @@ public partial class DeviceRegistry request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.CredentialsCreateOrUpdate_Call (request, onOk,onDefault,eventListener,sender); + await this.NamespaceAssetsCreateOrReplace_Call (request, onOk,onDefault,eventListener,sender); } } - /// update a Credential + /// replace a NamespaceAsset /// /// Resource create parameters. /// a delegate that is called when the remote service returns 200 (OK). @@ -5641,24 +5643,25 @@ public partial class DeviceRegistry /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task CredentialsCreateOrUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICredential body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeUpdate) + public async global::System.Threading.Tasks.Task NamespaceAssetsCreateOrReplaceViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceAsset body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.DeviceRegistry/namespaces/(?[^/]+)/credentials/default$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.DeviceRegistry/namespaces/(?[^/]+)/assets/(?[^/]+)$", 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.DeviceRegistry/namespaces/{namespaceName}/credentials/default'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/assets/{assetName}'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; var namespaceName = _match.Groups["namespaceName"].Value; + var assetName = _match.Groups["assetName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" @@ -5667,7 +5670,8 @@ public partial class DeviceRegistry + resourceGroupName + "/providers/Microsoft.DeviceRegistry/namespaces/" + namespaceName - + "/credentials/default" + + "/assets/" + + assetName + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -5685,38 +5689,39 @@ public partial class DeviceRegistry request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.CredentialsCreateOrUpdate_Call (request, onOk,onDefault,eventListener,sender); + await this.NamespaceAssetsCreateOrReplace_Call (request, onOk,onDefault,eventListener,sender); } } - /// update a Credential + /// replace a NamespaceAsset /// /// Resource create parameters. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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 CredentialsCreateOrUpdateViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICredential body, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeUpdate) + public async global::System.Threading.Tasks.Task NamespaceAssetsCreateOrReplaceViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceAsset body, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.DeviceRegistry/namespaces/(?[^/]+)/credentials/default$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.DeviceRegistry/namespaces/(?[^/]+)/assets/(?[^/]+)$", 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.DeviceRegistry/namespaces/{namespaceName}/credentials/default'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/assets/{assetName}'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; var namespaceName = _match.Groups["namespaceName"].Value; + var assetName = _match.Groups["assetName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" @@ -5725,7 +5730,8 @@ public partial class DeviceRegistry + resourceGroupName + "/providers/Microsoft.DeviceRegistry/namespaces/" + namespaceName - + "/credentials/default" + + "/assets/" + + assetName + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -5743,15 +5749,16 @@ public partial class DeviceRegistry request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - return await this.CredentialsCreateOrUpdateWithResult_Call (request, eventListener,sender); + return await this.NamespaceAssetsCreateOrReplaceWithResult_Call (request, eventListener,sender); } } - /// update a Credential + /// replace a NamespaceAsset /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// The name of the namespace. - /// Json string supplied to the CredentialsCreateOrUpdate operation + /// The name of the asset. + /// Json string supplied to the NamespaceAssetsCreateOrReplace 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). @@ -5760,9 +5767,9 @@ public partial class DeviceRegistry /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task CredentialsCreateOrUpdateViaJsonString(string subscriptionId, string resourceGroupName, string namespaceName, 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.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task NamespaceAssetsCreateOrReplaceViaJsonString(string subscriptionId, string resourceGroupName, string namespaceName, string assetName, 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.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -5774,7 +5781,8 @@ public partial class DeviceRegistry + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.DeviceRegistry/namespaces/" + global::System.Uri.EscapeDataString(namespaceName) - + "/credentials/default" + + "/assets/" + + global::System.Uri.EscapeDataString(assetName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -5792,24 +5800,25 @@ public partial class DeviceRegistry request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.CredentialsCreateOrUpdate_Call (request, onOk,onDefault,eventListener,sender); + await this.NamespaceAssetsCreateOrReplace_Call (request, onOk,onDefault,eventListener,sender); } } - /// update a Credential + /// replace a NamespaceAsset /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// The name of the namespace. - /// Json string supplied to the CredentialsCreateOrUpdate operation + /// The name of the asset. + /// Json string supplied to the NamespaceAssetsCreateOrReplace operation /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync pipeline to use to make the request. /// - /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task CredentialsCreateOrUpdateViaJsonStringWithResult(string subscriptionId, string resourceGroupName, string namespaceName, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task NamespaceAssetsCreateOrReplaceViaJsonStringWithResult(string subscriptionId, string resourceGroupName, string namespaceName, string assetName, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -5821,7 +5830,8 @@ public partial class DeviceRegistry + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.DeviceRegistry/namespaces/" + global::System.Uri.EscapeDataString(namespaceName) - + "/credentials/default" + + "/assets/" + + global::System.Uri.EscapeDataString(assetName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -5839,25 +5849,26 @@ public partial class DeviceRegistry request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - return await this.CredentialsCreateOrUpdateWithResult_Call (request, eventListener,sender); + return await this.NamespaceAssetsCreateOrReplaceWithResult_Call (request, eventListener,sender); } } - /// update a Credential + /// replace a NamespaceAsset /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// The name of the namespace. + /// The name of the asset. /// Resource create parameters. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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 CredentialsCreateOrUpdateWithResult(string subscriptionId, string resourceGroupName, string namespaceName, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICredential body, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeUpdate) + public async global::System.Threading.Tasks.Task NamespaceAssetsCreateOrReplaceWithResult(string subscriptionId, string resourceGroupName, string namespaceName, string assetName, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceAsset body, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -5869,7 +5880,8 @@ public partial class DeviceRegistry + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.DeviceRegistry/namespaces/" + global::System.Uri.EscapeDataString(namespaceName) - + "/credentials/default" + + "/assets/" + + global::System.Uri.EscapeDataString(assetName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -5887,21 +5899,21 @@ public partial class DeviceRegistry request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - return await this.CredentialsCreateOrUpdateWithResult_Call (request, eventListener,sender); + return await this.NamespaceAssetsCreateOrReplaceWithResult_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.DeviceRegistry.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 CredentialsCreateOrUpdateWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task NamespaceAssetsCreateOrReplaceWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -6012,7 +6024,7 @@ public partial class DeviceRegistry case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.Credential.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode.Parse(body.Result)) ); + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.NamespaceAsset.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode.Parse(body.Result)) ); return await _result; } default: @@ -6045,7 +6057,7 @@ public partial class DeviceRegistry } } - /// 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 @@ -6055,7 +6067,7 @@ public partial class DeviceRegistry /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task CredentialsCreateOrUpdate_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.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task NamespaceAssetsCreateOrReplace_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.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -6166,7 +6178,7 @@ public partial class DeviceRegistry case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.Credential.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.NamespaceAsset.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: @@ -6188,18 +6200,19 @@ public partial class DeviceRegistry } /// - /// 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 value must be an UUID. /// The name of the resource group. The name is case insensitive. /// The name of the namespace. + /// The name of the asset. /// Resource create parameters. /// 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 CredentialsCreateOrUpdate_Validate(string subscriptionId, string resourceGroupName, string namespaceName, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICredential body, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task NamespaceAssetsCreateOrReplace_Validate(string subscriptionId, string resourceGroupName, string namespaceName, string assetName, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceAsset body, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -6212,15 +6225,20 @@ public partial class DeviceRegistry await eventListener.AssertMinimumLength(nameof(namespaceName),namespaceName,3); await eventListener.AssertMaximumLength(nameof(namespaceName),namespaceName,64); await eventListener.AssertRegEx(nameof(namespaceName), namespaceName, @"^[a-z0-9][a-z0-9-]*[a-z0-9]$"); + await eventListener.AssertNotNull(nameof(assetName),assetName); + await eventListener.AssertMinimumLength(nameof(assetName),assetName,3); + await eventListener.AssertMaximumLength(nameof(assetName),assetName,63); + await eventListener.AssertRegEx(nameof(assetName), assetName, @"^[a-z0-9][a-z0-9-]*[a-z0-9]$"); await eventListener.AssertNotNull(nameof(body), body); await eventListener.AssertObjectIsValid(nameof(body), body); } } - /// Delete a Credential + /// Delete a NamespaceAsset /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// The name of the namespace. + /// The name of the asset. /// 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 @@ -6230,9 +6248,9 @@ public partial class DeviceRegistry /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task CredentialsDelete(string subscriptionId, string resourceGroupName, string namespaceName, global::System.Func onNoContent, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task NamespaceAssetsDelete(string subscriptionId, string resourceGroupName, string namespaceName, string assetName, global::System.Func onNoContent, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -6244,7 +6262,8 @@ public partial class DeviceRegistry + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.DeviceRegistry/namespaces/" + global::System.Uri.EscapeDataString(namespaceName) - + "/credentials/default" + + "/assets/" + + global::System.Uri.EscapeDataString(assetName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -6258,11 +6277,11 @@ public partial class DeviceRegistry await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.CredentialsDelete_Call (request, onNoContent,onOk,onDefault,eventListener,sender); + await this.NamespaceAssetsDelete_Call (request, onNoContent,onOk,onDefault,eventListener,sender); } } - /// Delete a Credential + /// Delete a NamespaceAsset /// /// a delegate that is called when the remote service returns 204 (NoContent). /// a delegate that is called when the remote service returns 200 (OK). @@ -6273,24 +6292,25 @@ public partial class DeviceRegistry /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task CredentialsDeleteViaIdentity(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.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task NamespaceAssetsDeleteViaIdentity(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.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.DeviceRegistry/namespaces/(?[^/]+)/credentials/default$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.DeviceRegistry/namespaces/(?[^/]+)/assets/(?[^/]+)$", 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.DeviceRegistry/namespaces/{namespaceName}/credentials/default'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/assets/{assetName}'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; var namespaceName = _match.Groups["namespaceName"].Value; + var assetName = _match.Groups["assetName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" @@ -6299,7 +6319,8 @@ public partial class DeviceRegistry + resourceGroupName + "/providers/Microsoft.DeviceRegistry/namespaces/" + namespaceName - + "/credentials/default" + + "/assets/" + + assetName + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -6313,11 +6334,11 @@ public partial class DeviceRegistry await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.CredentialsDelete_Call (request, onNoContent,onOk,onDefault,eventListener,sender); + await this.NamespaceAssetsDelete_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). @@ -6328,7 +6349,7 @@ public partial class DeviceRegistry /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task CredentialsDelete_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.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task NamespaceAssetsDelete_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.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -6468,17 +6489,18 @@ public partial class DeviceRegistry } /// - /// 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 value must be an UUID. /// The name of the resource group. The name is case insensitive. /// The name of the namespace. + /// The name of the asset. /// 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 CredentialsDelete_Validate(string subscriptionId, string resourceGroupName, string namespaceName, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task NamespaceAssetsDelete_Validate(string subscriptionId, string resourceGroupName, string namespaceName, string assetName, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -6491,13 +6513,18 @@ public partial class DeviceRegistry await eventListener.AssertMinimumLength(nameof(namespaceName),namespaceName,3); await eventListener.AssertMaximumLength(nameof(namespaceName),namespaceName,64); await eventListener.AssertRegEx(nameof(namespaceName), namespaceName, @"^[a-z0-9][a-z0-9-]*[a-z0-9]$"); + await eventListener.AssertNotNull(nameof(assetName),assetName); + await eventListener.AssertMinimumLength(nameof(assetName),assetName,3); + await eventListener.AssertMaximumLength(nameof(assetName),assetName,63); + await eventListener.AssertRegEx(nameof(assetName), assetName, @"^[a-z0-9][a-z0-9-]*[a-z0-9]$"); } } - /// Get a Credential + /// Get a NamespaceAsset /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// The name of the namespace. + /// The name of the asset. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). @@ -6506,9 +6533,9 @@ public partial class DeviceRegistry /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task CredentialsGet(string subscriptionId, string resourceGroupName, string namespaceName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task NamespaceAssetsGet(string subscriptionId, string resourceGroupName, string namespaceName, string assetName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -6520,7 +6547,8 @@ public partial class DeviceRegistry + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.DeviceRegistry/namespaces/" + global::System.Uri.EscapeDataString(namespaceName) - + "/credentials/default" + + "/assets/" + + global::System.Uri.EscapeDataString(assetName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -6534,11 +6562,11 @@ public partial class DeviceRegistry await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.CredentialsGet_Call (request, onOk,onDefault,eventListener,sender); + await this.NamespaceAssetsGet_Call (request, onOk,onDefault,eventListener,sender); } } - /// Get a Credential + /// Get a NamespaceAsset /// /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled @@ -6548,24 +6576,25 @@ public partial class DeviceRegistry /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task CredentialsGetViaIdentity(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.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task NamespaceAssetsGetViaIdentity(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.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.DeviceRegistry/namespaces/(?[^/]+)/credentials/default$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.DeviceRegistry/namespaces/(?[^/]+)/assets/(?[^/]+)$", 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.DeviceRegistry/namespaces/{namespaceName}/credentials/default'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/assets/{assetName}'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; var namespaceName = _match.Groups["namespaceName"].Value; + var assetName = _match.Groups["assetName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" @@ -6574,7 +6603,8 @@ public partial class DeviceRegistry + resourceGroupName + "/providers/Microsoft.DeviceRegistry/namespaces/" + namespaceName - + "/credentials/default" + + "/assets/" + + assetName + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -6588,36 +6618,37 @@ public partial class DeviceRegistry await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.CredentialsGet_Call (request, onOk,onDefault,eventListener,sender); + await this.NamespaceAssetsGet_Call (request, onOk,onDefault,eventListener,sender); } } - /// Get a Credential + /// Get a NamespaceAsset /// /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync pipeline to use to make the request. /// - /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task CredentialsGetViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task NamespaceAssetsGetViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.DeviceRegistry/namespaces/(?[^/]+)/credentials/default$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.DeviceRegistry/namespaces/(?[^/]+)/assets/(?[^/]+)$", 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.DeviceRegistry/namespaces/{namespaceName}/credentials/default'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/assets/{assetName}'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; var namespaceName = _match.Groups["namespaceName"].Value; + var assetName = _match.Groups["assetName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" @@ -6626,7 +6657,8 @@ public partial class DeviceRegistry + resourceGroupName + "/providers/Microsoft.DeviceRegistry/namespaces/" + namespaceName - + "/credentials/default" + + "/assets/" + + assetName + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -6640,23 +6672,24 @@ public partial class DeviceRegistry await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - return await this.CredentialsGetWithResult_Call (request, eventListener,sender); + return await this.NamespaceAssetsGetWithResult_Call (request, eventListener,sender); } } - /// Get a Credential + /// Get a NamespaceAsset /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// The name of the namespace. + /// The name of the asset. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync pipeline to use to make the request. /// - /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task CredentialsGetWithResult(string subscriptionId, string resourceGroupName, string namespaceName, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task NamespaceAssetsGetWithResult(string subscriptionId, string resourceGroupName, string namespaceName, string assetName, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -6668,7 +6701,8 @@ public partial class DeviceRegistry + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.DeviceRegistry/namespaces/" + global::System.Uri.EscapeDataString(namespaceName) - + "/credentials/default" + + "/assets/" + + global::System.Uri.EscapeDataString(assetName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -6682,19 +6716,19 @@ public partial class DeviceRegistry await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - return await this.CredentialsGetWithResult_Call (request, eventListener,sender); + return await this.NamespaceAssetsGetWithResult_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.DeviceRegistry.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 CredentialsGetWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task NamespaceAssetsGetWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -6713,7 +6747,7 @@ public partial class DeviceRegistry case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.Credential.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode.Parse(body.Result)) ); + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.NamespaceAsset.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode.Parse(body.Result)) ); return await _result; } default: @@ -6746,7 +6780,7 @@ public partial class DeviceRegistry } } - /// 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 @@ -6756,7 +6790,7 @@ public partial class DeviceRegistry /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task CredentialsGet_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.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task NamespaceAssetsGet_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.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -6775,7 +6809,7 @@ public partial class DeviceRegistry case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.Credential.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.NamespaceAsset.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: @@ -6797,17 +6831,18 @@ public partial class DeviceRegistry } /// - /// 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 value must be an UUID. /// The name of the resource group. The name is case insensitive. /// The name of the namespace. + /// The name of the asset. /// 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 CredentialsGet_Validate(string subscriptionId, string resourceGroupName, string namespaceName, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task NamespaceAssetsGet_Validate(string subscriptionId, string resourceGroupName, string namespaceName, string assetName, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -6820,10 +6855,14 @@ public partial class DeviceRegistry await eventListener.AssertMinimumLength(nameof(namespaceName),namespaceName,3); await eventListener.AssertMaximumLength(nameof(namespaceName),namespaceName,64); await eventListener.AssertRegEx(nameof(namespaceName), namespaceName, @"^[a-z0-9][a-z0-9-]*[a-z0-9]$"); + await eventListener.AssertNotNull(nameof(assetName),assetName); + await eventListener.AssertMinimumLength(nameof(assetName),assetName,3); + await eventListener.AssertMaximumLength(nameof(assetName),assetName,63); + await eventListener.AssertRegEx(nameof(assetName), assetName, @"^[a-z0-9][a-z0-9-]*[a-z0-9]$"); } } - /// List Credential resources by Namespace + /// List NamespaceAsset resources by Namespace /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// The name of the namespace. @@ -6835,9 +6874,9 @@ public partial class DeviceRegistry /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task CredentialsListByResourceGroup(string subscriptionId, string resourceGroupName, string namespaceName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task NamespaceAssetsListByResourceGroup(string subscriptionId, string resourceGroupName, string namespaceName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -6849,7 +6888,7 @@ public partial class DeviceRegistry + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.DeviceRegistry/namespaces/" + global::System.Uri.EscapeDataString(namespaceName) - + "/credentials" + + "/assets" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -6863,11 +6902,11 @@ public partial class DeviceRegistry await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.CredentialsListByResourceGroup_Call (request, onOk,onDefault,eventListener,sender); + await this.NamespaceAssetsListByResourceGroup_Call (request, onOk,onDefault,eventListener,sender); } } - /// List Credential resources by Namespace + /// List NamespaceAsset resources by Namespace /// /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled @@ -6877,18 +6916,18 @@ public partial class DeviceRegistry /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task CredentialsListByResourceGroupViaIdentity(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.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task NamespaceAssetsListByResourceGroupViaIdentity(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.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.DeviceRegistry/namespaces/(?[^/]+)/credentials$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.DeviceRegistry/namespaces/(?[^/]+)/assets$", 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.DeviceRegistry/namespaces/{namespaceName}/credentials'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/assets'"); } // replace URI parameters with values from identity @@ -6903,7 +6942,7 @@ public partial class DeviceRegistry + resourceGroupName + "/providers/Microsoft.DeviceRegistry/namespaces/" + namespaceName - + "/credentials" + + "/assets" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -6917,30 +6956,30 @@ public partial class DeviceRegistry await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.CredentialsListByResourceGroup_Call (request, onOk,onDefault,eventListener,sender); + await this.NamespaceAssetsListByResourceGroup_Call (request, onOk,onDefault,eventListener,sender); } } - /// List Credential resources by Namespace + /// List NamespaceAsset resources by Namespace /// /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync pipeline to use to make the request. /// - /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task CredentialsListByResourceGroupViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task NamespaceAssetsListByResourceGroupViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.DeviceRegistry/namespaces/(?[^/]+)/credentials$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.DeviceRegistry/namespaces/(?[^/]+)/assets$", 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.DeviceRegistry/namespaces/{namespaceName}/credentials'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/assets'"); } // replace URI parameters with values from identity @@ -6955,7 +6994,7 @@ public partial class DeviceRegistry + resourceGroupName + "/providers/Microsoft.DeviceRegistry/namespaces/" + namespaceName - + "/credentials" + + "/assets" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -6969,23 +7008,23 @@ public partial class DeviceRegistry await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - return await this.CredentialsListByResourceGroupWithResult_Call (request, eventListener,sender); + return await this.NamespaceAssetsListByResourceGroupWithResult_Call (request, eventListener,sender); } } - /// List Credential resources by Namespace + /// List NamespaceAsset resources by Namespace /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// The name of the namespace. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync pipeline to use to make the request. /// - /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task CredentialsListByResourceGroupWithResult(string subscriptionId, string resourceGroupName, string namespaceName, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task NamespaceAssetsListByResourceGroupWithResult(string subscriptionId, string resourceGroupName, string namespaceName, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -6997,7 +7036,7 @@ public partial class DeviceRegistry + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.DeviceRegistry/namespaces/" + global::System.Uri.EscapeDataString(namespaceName) - + "/credentials" + + "/assets" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -7011,21 +7050,21 @@ public partial class DeviceRegistry await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - return await this.CredentialsListByResourceGroupWithResult_Call (request, eventListener,sender); + return await this.NamespaceAssetsListByResourceGroupWithResult_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.DeviceRegistry.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 CredentialsListByResourceGroupWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task NamespaceAssetsListByResourceGroupWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -7044,7 +7083,7 @@ public partial class DeviceRegistry case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.CredentialListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode.Parse(body.Result)) ); + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.NamespaceAssetListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode.Parse(body.Result)) ); return await _result; } default: @@ -7077,7 +7116,7 @@ public partial class DeviceRegistry } } - /// 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 @@ -7087,7 +7126,7 @@ public partial class DeviceRegistry /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task CredentialsListByResourceGroup_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.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task NamespaceAssetsListByResourceGroup_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.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -7106,7 +7145,7 @@ public partial class DeviceRegistry case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.CredentialListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.NamespaceAssetListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: @@ -7128,8 +7167,8 @@ public partial class DeviceRegistry } /// - /// 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 value must be an UUID. /// The name of the resource group. The name is case insensitive. @@ -7138,7 +7177,7 @@ public partial class DeviceRegistry /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task CredentialsListByResourceGroup_Validate(string subscriptionId, string resourceGroupName, string namespaceName, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task NamespaceAssetsListByResourceGroup_Validate(string subscriptionId, string resourceGroupName, string namespaceName, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -7154,21 +7193,24 @@ public partial class DeviceRegistry } } - /// A long-running resource action. + /// update a NamespaceAsset /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// The name of the namespace. + /// The name of the asset. + /// The resource properties to be updated. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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 CredentialsSynchronize(string subscriptionId, string resourceGroupName, string namespaceName, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task NamespaceAssetsUpdate(string subscriptionId, string resourceGroupName, string namespaceName, string assetName, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceAssetUpdate body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -7180,7 +7222,8 @@ public partial class DeviceRegistry + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.DeviceRegistry/namespaces/" + global::System.Uri.EscapeDataString(namespaceName) - + "/credentials/default/synchronize" + + "/assets/" + + global::System.Uri.EscapeDataString(assetName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -7189,43 +7232,50 @@ public partial class DeviceRegistry // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Method.Post, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Method.Patch, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.CredentialsSynchronize_Call (request, onOk,onDefault,eventListener,sender); + await this.NamespaceAssetsUpdate_Call (request, onOk,onDefault,eventListener,sender); } } - /// A long-running resource action. + /// update a NamespaceAsset /// + /// The resource properties to be updated. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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 CredentialsSynchronizeViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task NamespaceAssetsUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceAssetUpdate body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.DeviceRegistry/namespaces/(?[^/]+)/credentials/default$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.DeviceRegistry/namespaces/(?[^/]+)/assets/(?[^/]+)$", 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.DeviceRegistry/namespaces/{namespaceName}/credentials/default'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/assets/{assetName}'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; var namespaceName = _match.Groups["namespaceName"].Value; + var assetName = _match.Groups["assetName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" @@ -7234,7 +7284,8 @@ public partial class DeviceRegistry + resourceGroupName + "/providers/Microsoft.DeviceRegistry/namespaces/" + namespaceName - + "/credentials/default/synchronize" + + "/assets/" + + assetName + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -7243,323 +7294,48 @@ public partial class DeviceRegistry // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Method.Post, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Method.Patch, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.CredentialsSynchronize_Call (request, onOk,onDefault,eventListener,sender); + await this.NamespaceAssetsUpdate_Call (request, onOk,onDefault,eventListener,sender); } } - /// Actual wire call for method. - /// the prepared HttpRequestMessage to send. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). + /// update a NamespaceAsset + /// + /// The resource properties to be updated. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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 CredentialsSynchronize_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task NamespaceAssetsUpdateViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceAssetUpdate body, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeUpdate) { + var apiVersion = @"2025-10-01"; + // Constant Parameters using( NoSynchronizationContext ) { - global::System.Net.Http.HttpResponseMessage _response = null; - try - { - // this operation supports x-ms-long-running-operation - var _originalUri = request.RequestUri.AbsoluteUri; - var sendTask = sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // 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.DeviceRegistry.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.DeviceRegistry.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(); + // verify that Identity format is an exact match for uri - // make the polling call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - break; - } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } - } - finally - { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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 value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of the namespace. - /// 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 CredentialsSynchronize_Validate(string subscriptionId, string resourceGroupName, string namespaceName, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener) - { - using( NoSynchronizationContext ) - { - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); - await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); - await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); - await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); - await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertNotNull(nameof(namespaceName),namespaceName); - await eventListener.AssertMinimumLength(nameof(namespaceName),namespaceName,3); - await eventListener.AssertMaximumLength(nameof(namespaceName),namespaceName,64); - await eventListener.AssertRegEx(nameof(namespaceName), namespaceName, @"^[a-z0-9][a-z0-9-]*[a-z0-9]$"); - } - } - - /// update a Credential - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of the namespace. - /// The resource properties to be updated. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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 CredentialsUpdate(string subscriptionId, string resourceGroupName, string namespaceName, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICredentialUpdate body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeUpdate) - { - var apiVersion = @"2025-11-01-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.DeviceRegistry/namespaces/" - + global::System.Uri.EscapeDataString(namespaceName) - + "/credentials/default" - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.Method.Patch, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.CredentialsUpdate_Call (request, onOk,onDefault,eventListener,sender); - } - } - - /// update a Credential - /// - /// The resource properties to be updated. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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 CredentialsUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICredentialUpdate body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeUpdate) - { - var apiVersion = @"2025-11-01-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.DeviceRegistry/namespaces/(?[^/]+)/credentials/default$", 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.DeviceRegistry/namespaces/{namespaceName}/credentials/default'"); - } - - // replace URI parameters with values from identity - var subscriptionId = _match.Groups["subscriptionId"].Value; - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var namespaceName = _match.Groups["namespaceName"].Value; - // construct URL - var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/subscriptions/" - + subscriptionId - + "/resourceGroups/" - + resourceGroupName - + "/providers/Microsoft.DeviceRegistry/namespaces/" - + namespaceName - + "/credentials/default" - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.Method.Patch, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.CredentialsUpdate_Call (request, onOk,onDefault,eventListener,sender); - } - } - - /// update a Credential - /// - /// The resource properties to be updated. - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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 CredentialsUpdateViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICredentialUpdate body, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeUpdate) - { - var apiVersion = @"2025-11-01-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.DeviceRegistry/namespaces/(?[^/]+)/credentials/default$", 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.DeviceRegistry/namespaces/{namespaceName}/credentials/default'"); - } + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.DeviceRegistry/namespaces/(?[^/]+)/assets/(?[^/]+)$", 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.DeviceRegistry/namespaces/{namespaceName}/assets/{assetName}'"); + } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; var namespaceName = _match.Groups["namespaceName"].Value; + var assetName = _match.Groups["assetName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" @@ -7568,7 +7344,8 @@ public partial class DeviceRegistry + resourceGroupName + "/providers/Microsoft.DeviceRegistry/namespaces/" + namespaceName - + "/credentials/default" + + "/assets/" + + assetName + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -7586,15 +7363,16 @@ public partial class DeviceRegistry request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - return await this.CredentialsUpdateWithResult_Call (request, eventListener,sender); + return await this.NamespaceAssetsUpdateWithResult_Call (request, eventListener,sender); } } - /// update a Credential + /// update a NamespaceAsset /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// The name of the namespace. - /// Json string supplied to the CredentialsUpdate operation + /// The name of the asset. + /// Json string supplied to the NamespaceAssetsUpdate 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). @@ -7603,9 +7381,9 @@ public partial class DeviceRegistry /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task CredentialsUpdateViaJsonString(string subscriptionId, string resourceGroupName, string namespaceName, 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.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task NamespaceAssetsUpdateViaJsonString(string subscriptionId, string resourceGroupName, string namespaceName, string assetName, 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.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -7617,7 +7395,8 @@ public partial class DeviceRegistry + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.DeviceRegistry/namespaces/" + global::System.Uri.EscapeDataString(namespaceName) - + "/credentials/default" + + "/assets/" + + global::System.Uri.EscapeDataString(assetName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -7635,24 +7414,25 @@ public partial class DeviceRegistry request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.CredentialsUpdate_Call (request, onOk,onDefault,eventListener,sender); + await this.NamespaceAssetsUpdate_Call (request, onOk,onDefault,eventListener,sender); } } - /// update a Credential + /// update a NamespaceAsset /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// The name of the namespace. - /// Json string supplied to the CredentialsUpdate operation + /// The name of the asset. + /// Json string supplied to the NamespaceAssetsUpdate operation /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync pipeline to use to make the request. /// - /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task CredentialsUpdateViaJsonStringWithResult(string subscriptionId, string resourceGroupName, string namespaceName, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task NamespaceAssetsUpdateViaJsonStringWithResult(string subscriptionId, string resourceGroupName, string namespaceName, string assetName, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -7664,7 +7444,8 @@ public partial class DeviceRegistry + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.DeviceRegistry/namespaces/" + global::System.Uri.EscapeDataString(namespaceName) - + "/credentials/default" + + "/assets/" + + global::System.Uri.EscapeDataString(assetName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -7682,25 +7463,26 @@ public partial class DeviceRegistry request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - return await this.CredentialsUpdateWithResult_Call (request, eventListener,sender); + return await this.NamespaceAssetsUpdateWithResult_Call (request, eventListener,sender); } } - /// update a Credential + /// update a NamespaceAsset /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// The name of the namespace. + /// The name of the asset. /// The resource properties to be updated. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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 CredentialsUpdateWithResult(string subscriptionId, string resourceGroupName, string namespaceName, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICredentialUpdate body, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeUpdate) + public async global::System.Threading.Tasks.Task NamespaceAssetsUpdateWithResult(string subscriptionId, string resourceGroupName, string namespaceName, string assetName, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceAssetUpdate body, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -7712,7 +7494,8 @@ public partial class DeviceRegistry + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.DeviceRegistry/namespaces/" + global::System.Uri.EscapeDataString(namespaceName) - + "/credentials/default" + + "/assets/" + + global::System.Uri.EscapeDataString(assetName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -7730,19 +7513,19 @@ public partial class DeviceRegistry request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - return await this.CredentialsUpdateWithResult_Call (request, eventListener,sender); + return await this.NamespaceAssetsUpdateWithResult_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.DeviceRegistry.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 CredentialsUpdateWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task NamespaceAssetsUpdateWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -7854,7 +7637,7 @@ public partial class DeviceRegistry case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.Credential.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode.Parse(body.Result)) ); + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.NamespaceAsset.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode.Parse(body.Result)) ); return await _result; } default: @@ -7887,7 +7670,7 @@ public partial class DeviceRegistry } } - /// 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 @@ -7897,7 +7680,7 @@ public partial class DeviceRegistry /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task CredentialsUpdate_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.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task NamespaceAssetsUpdate_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.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -8009,7 +7792,7 @@ public partial class DeviceRegistry case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.Credential.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.NamespaceAsset.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: @@ -8031,18 +7814,19 @@ public partial class DeviceRegistry } /// - /// 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 value must be an UUID. /// The name of the resource group. The name is case insensitive. /// The name of the namespace. + /// The name of the asset. /// The resource properties to be updated. /// 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 CredentialsUpdate_Validate(string subscriptionId, string resourceGroupName, string namespaceName, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICredentialUpdate body, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task NamespaceAssetsUpdate_Validate(string subscriptionId, string resourceGroupName, string namespaceName, string assetName, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceAssetUpdate body, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -8055,16 +7839,20 @@ public partial class DeviceRegistry await eventListener.AssertMinimumLength(nameof(namespaceName),namespaceName,3); await eventListener.AssertMaximumLength(nameof(namespaceName),namespaceName,64); await eventListener.AssertRegEx(nameof(namespaceName), namespaceName, @"^[a-z0-9][a-z0-9-]*[a-z0-9]$"); + await eventListener.AssertNotNull(nameof(assetName),assetName); + await eventListener.AssertMinimumLength(nameof(assetName),assetName,3); + await eventListener.AssertMaximumLength(nameof(assetName),assetName,63); + await eventListener.AssertRegEx(nameof(assetName), assetName, @"^[a-z0-9][a-z0-9-]*[a-z0-9]$"); await eventListener.AssertNotNull(nameof(body), body); await eventListener.AssertObjectIsValid(nameof(body), body); } } - /// replace a NamespaceAsset + /// replace a NamespaceDevice /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// The name of the namespace. - /// The name of the asset. + /// The name of the device. /// Resource create parameters. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled @@ -8075,9 +7863,9 @@ public partial class DeviceRegistry /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task NamespaceAssetsCreateOrReplace(string subscriptionId, string resourceGroupName, string namespaceName, string assetName, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceAsset body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeUpdate) + public async global::System.Threading.Tasks.Task NamespaceDevicesCreateOrReplace(string subscriptionId, string resourceGroupName, string namespaceName, string deviceName, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDevice body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -8089,8 +7877,8 @@ public partial class DeviceRegistry + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.DeviceRegistry/namespaces/" + global::System.Uri.EscapeDataString(namespaceName) - + "/assets/" - + global::System.Uri.EscapeDataString(assetName) + + "/devices/" + + global::System.Uri.EscapeDataString(deviceName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -8108,11 +7896,11 @@ public partial class DeviceRegistry request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.NamespaceAssetsCreateOrReplace_Call (request, onOk,onDefault,eventListener,sender); + await this.NamespaceDevicesCreateOrReplace_Call (request, onOk,onDefault,eventListener,sender); } } - /// replace a NamespaceAsset + /// replace a NamespaceDevice /// /// Resource create parameters. /// a delegate that is called when the remote service returns 200 (OK). @@ -8124,25 +7912,25 @@ public partial class DeviceRegistry /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task NamespaceAssetsCreateOrReplaceViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceAsset body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeUpdate) + public async global::System.Threading.Tasks.Task NamespaceDevicesCreateOrReplaceViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDevice body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.DeviceRegistry/namespaces/(?[^/]+)/assets/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.DeviceRegistry/namespaces/(?[^/]+)/devices/(?[^/]+)$", 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.DeviceRegistry/namespaces/{namespaceName}/assets/{assetName}'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/devices/{deviceName}'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; var namespaceName = _match.Groups["namespaceName"].Value; - var assetName = _match.Groups["assetName"].Value; + var deviceName = _match.Groups["deviceName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" @@ -8151,8 +7939,8 @@ public partial class DeviceRegistry + resourceGroupName + "/providers/Microsoft.DeviceRegistry/namespaces/" + namespaceName - + "/assets/" - + assetName + + "/devices/" + + deviceName + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -8170,39 +7958,39 @@ public partial class DeviceRegistry request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.NamespaceAssetsCreateOrReplace_Call (request, onOk,onDefault,eventListener,sender); + await this.NamespaceDevicesCreateOrReplace_Call (request, onOk,onDefault,eventListener,sender); } } - /// replace a NamespaceAsset + /// replace a NamespaceDevice /// /// Resource create parameters. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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 NamespaceAssetsCreateOrReplaceViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceAsset body, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeUpdate) + public async global::System.Threading.Tasks.Task NamespaceDevicesCreateOrReplaceViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDevice body, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.DeviceRegistry/namespaces/(?[^/]+)/assets/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.DeviceRegistry/namespaces/(?[^/]+)/devices/(?[^/]+)$", 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.DeviceRegistry/namespaces/{namespaceName}/assets/{assetName}'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/devices/{deviceName}'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; var namespaceName = _match.Groups["namespaceName"].Value; - var assetName = _match.Groups["assetName"].Value; + var deviceName = _match.Groups["deviceName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" @@ -8211,8 +7999,8 @@ public partial class DeviceRegistry + resourceGroupName + "/providers/Microsoft.DeviceRegistry/namespaces/" + namespaceName - + "/assets/" - + assetName + + "/devices/" + + deviceName + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -8230,16 +8018,16 @@ public partial class DeviceRegistry request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - return await this.NamespaceAssetsCreateOrReplaceWithResult_Call (request, eventListener,sender); + return await this.NamespaceDevicesCreateOrReplaceWithResult_Call (request, eventListener,sender); } } - /// replace a NamespaceAsset + /// replace a NamespaceDevice /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// The name of the namespace. - /// The name of the asset. - /// Json string supplied to the NamespaceAssetsCreateOrReplace operation + /// The name of the device. + /// Json string supplied to the NamespaceDevicesCreateOrReplace 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). @@ -8248,9 +8036,9 @@ public partial class DeviceRegistry /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task NamespaceAssetsCreateOrReplaceViaJsonString(string subscriptionId, string resourceGroupName, string namespaceName, string assetName, 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.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task NamespaceDevicesCreateOrReplaceViaJsonString(string subscriptionId, string resourceGroupName, string namespaceName, string deviceName, 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.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -8262,8 +8050,8 @@ public partial class DeviceRegistry + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.DeviceRegistry/namespaces/" + global::System.Uri.EscapeDataString(namespaceName) - + "/assets/" - + global::System.Uri.EscapeDataString(assetName) + + "/devices/" + + global::System.Uri.EscapeDataString(deviceName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -8281,25 +8069,25 @@ public partial class DeviceRegistry request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.NamespaceAssetsCreateOrReplace_Call (request, onOk,onDefault,eventListener,sender); + await this.NamespaceDevicesCreateOrReplace_Call (request, onOk,onDefault,eventListener,sender); } } - /// replace a NamespaceAsset + /// replace a NamespaceDevice /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// The name of the namespace. - /// The name of the asset. - /// Json string supplied to the NamespaceAssetsCreateOrReplace operation + /// The name of the device. + /// Json string supplied to the NamespaceDevicesCreateOrReplace operation /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync pipeline to use to make the request. /// - /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task NamespaceAssetsCreateOrReplaceViaJsonStringWithResult(string subscriptionId, string resourceGroupName, string namespaceName, string assetName, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task NamespaceDevicesCreateOrReplaceViaJsonStringWithResult(string subscriptionId, string resourceGroupName, string namespaceName, string deviceName, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -8311,8 +8099,8 @@ public partial class DeviceRegistry + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.DeviceRegistry/namespaces/" + global::System.Uri.EscapeDataString(namespaceName) - + "/assets/" - + global::System.Uri.EscapeDataString(assetName) + + "/devices/" + + global::System.Uri.EscapeDataString(deviceName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -8330,26 +8118,26 @@ public partial class DeviceRegistry request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - return await this.NamespaceAssetsCreateOrReplaceWithResult_Call (request, eventListener,sender); + return await this.NamespaceDevicesCreateOrReplaceWithResult_Call (request, eventListener,sender); } } - /// replace a NamespaceAsset + /// replace a NamespaceDevice /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// The name of the namespace. - /// The name of the asset. + /// The name of the device. /// Resource create parameters. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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 NamespaceAssetsCreateOrReplaceWithResult(string subscriptionId, string resourceGroupName, string namespaceName, string assetName, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceAsset body, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeUpdate) + public async global::System.Threading.Tasks.Task NamespaceDevicesCreateOrReplaceWithResult(string subscriptionId, string resourceGroupName, string namespaceName, string deviceName, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDevice body, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -8361,8 +8149,8 @@ public partial class DeviceRegistry + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.DeviceRegistry/namespaces/" + global::System.Uri.EscapeDataString(namespaceName) - + "/assets/" - + global::System.Uri.EscapeDataString(assetName) + + "/devices/" + + global::System.Uri.EscapeDataString(deviceName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -8380,21 +8168,21 @@ public partial class DeviceRegistry request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - return await this.NamespaceAssetsCreateOrReplaceWithResult_Call (request, eventListener,sender); + return await this.NamespaceDevicesCreateOrReplaceWithResult_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.DeviceRegistry.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 NamespaceAssetsCreateOrReplaceWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task NamespaceDevicesCreateOrReplaceWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -8505,7 +8293,7 @@ public partial class DeviceRegistry case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.NamespaceAsset.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode.Parse(body.Result)) ); + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.NamespaceDevice.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode.Parse(body.Result)) ); return await _result; } default: @@ -8538,7 +8326,7 @@ public partial class DeviceRegistry } } - /// 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 @@ -8548,7 +8336,7 @@ public partial class DeviceRegistry /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task NamespaceAssetsCreateOrReplace_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.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task NamespaceDevicesCreateOrReplace_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.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -8659,7 +8447,7 @@ public partial class DeviceRegistry case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.NamespaceAsset.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.NamespaceDevice.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: @@ -8681,19 +8469,19 @@ public partial class DeviceRegistry } /// - /// Validation method for method. Call this like the actual call, but you will + /// Validation method for method. Call this like the actual call, but you will /// get validation events back. /// /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// The name of the namespace. - /// The name of the asset. + /// The name of the device. /// Resource create parameters. /// 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 NamespaceAssetsCreateOrReplace_Validate(string subscriptionId, string resourceGroupName, string namespaceName, string assetName, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceAsset body, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task NamespaceDevicesCreateOrReplace_Validate(string subscriptionId, string resourceGroupName, string namespaceName, string deviceName, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDevice body, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -8706,20 +8494,20 @@ public partial class DeviceRegistry await eventListener.AssertMinimumLength(nameof(namespaceName),namespaceName,3); await eventListener.AssertMaximumLength(nameof(namespaceName),namespaceName,64); await eventListener.AssertRegEx(nameof(namespaceName), namespaceName, @"^[a-z0-9][a-z0-9-]*[a-z0-9]$"); - await eventListener.AssertNotNull(nameof(assetName),assetName); - await eventListener.AssertMinimumLength(nameof(assetName),assetName,3); - await eventListener.AssertMaximumLength(nameof(assetName),assetName,63); - await eventListener.AssertRegEx(nameof(assetName), assetName, @"^[a-z0-9][a-z0-9-]*[a-z0-9]$"); + await eventListener.AssertNotNull(nameof(deviceName),deviceName); + await eventListener.AssertMinimumLength(nameof(deviceName),deviceName,3); + await eventListener.AssertMaximumLength(nameof(deviceName),deviceName,63); + await eventListener.AssertRegEx(nameof(deviceName), deviceName, @"^[0-9a-zA-Z][a-zA-Z0-9-]*$"); await eventListener.AssertNotNull(nameof(body), body); await eventListener.AssertObjectIsValid(nameof(body), body); } } - /// Delete a NamespaceAsset + /// Delete a NamespaceDevice /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// The name of the namespace. - /// The name of the asset. + /// The name of the device. /// 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 @@ -8729,9 +8517,9 @@ public partial class DeviceRegistry /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task NamespaceAssetsDelete(string subscriptionId, string resourceGroupName, string namespaceName, string assetName, global::System.Func onNoContent, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task NamespaceDevicesDelete(string subscriptionId, string resourceGroupName, string namespaceName, string deviceName, global::System.Func onNoContent, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -8743,8 +8531,8 @@ public partial class DeviceRegistry + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.DeviceRegistry/namespaces/" + global::System.Uri.EscapeDataString(namespaceName) - + "/assets/" - + global::System.Uri.EscapeDataString(assetName) + + "/devices/" + + global::System.Uri.EscapeDataString(deviceName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -8758,11 +8546,11 @@ public partial class DeviceRegistry await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.NamespaceAssetsDelete_Call (request, onNoContent,onOk,onDefault,eventListener,sender); + await this.NamespaceDevicesDelete_Call (request, onNoContent,onOk,onDefault,eventListener,sender); } } - /// Delete a NamespaceAsset + /// Delete a NamespaceDevice /// /// a delegate that is called when the remote service returns 204 (NoContent). /// a delegate that is called when the remote service returns 200 (OK). @@ -8773,25 +8561,25 @@ public partial class DeviceRegistry /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task NamespaceAssetsDeleteViaIdentity(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.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task NamespaceDevicesDeleteViaIdentity(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.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.DeviceRegistry/namespaces/(?[^/]+)/assets/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.DeviceRegistry/namespaces/(?[^/]+)/devices/(?[^/]+)$", 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.DeviceRegistry/namespaces/{namespaceName}/assets/{assetName}'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/devices/{deviceName}'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; var namespaceName = _match.Groups["namespaceName"].Value; - var assetName = _match.Groups["assetName"].Value; + var deviceName = _match.Groups["deviceName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" @@ -8800,8 +8588,8 @@ public partial class DeviceRegistry + resourceGroupName + "/providers/Microsoft.DeviceRegistry/namespaces/" + namespaceName - + "/assets/" - + assetName + + "/devices/" + + deviceName + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -8815,11 +8603,11 @@ public partial class DeviceRegistry await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.NamespaceAssetsDelete_Call (request, onNoContent,onOk,onDefault,eventListener,sender); + await this.NamespaceDevicesDelete_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). @@ -8830,7 +8618,7 @@ public partial class DeviceRegistry /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task NamespaceAssetsDelete_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.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task NamespaceDevicesDelete_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.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -8970,18 +8758,18 @@ public partial class DeviceRegistry } /// - /// 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 value must be an UUID. /// The name of the resource group. The name is case insensitive. /// The name of the namespace. - /// The name of the asset. + /// The name of the device. /// 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 NamespaceAssetsDelete_Validate(string subscriptionId, string resourceGroupName, string namespaceName, string assetName, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task NamespaceDevicesDelete_Validate(string subscriptionId, string resourceGroupName, string namespaceName, string deviceName, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -8994,18 +8782,18 @@ public partial class DeviceRegistry await eventListener.AssertMinimumLength(nameof(namespaceName),namespaceName,3); await eventListener.AssertMaximumLength(nameof(namespaceName),namespaceName,64); await eventListener.AssertRegEx(nameof(namespaceName), namespaceName, @"^[a-z0-9][a-z0-9-]*[a-z0-9]$"); - await eventListener.AssertNotNull(nameof(assetName),assetName); - await eventListener.AssertMinimumLength(nameof(assetName),assetName,3); - await eventListener.AssertMaximumLength(nameof(assetName),assetName,63); - await eventListener.AssertRegEx(nameof(assetName), assetName, @"^[a-z0-9][a-z0-9-]*[a-z0-9]$"); + await eventListener.AssertNotNull(nameof(deviceName),deviceName); + await eventListener.AssertMinimumLength(nameof(deviceName),deviceName,3); + await eventListener.AssertMaximumLength(nameof(deviceName),deviceName,63); + await eventListener.AssertRegEx(nameof(deviceName), deviceName, @"^[0-9a-zA-Z][a-zA-Z0-9-]*$"); } } - /// Get a NamespaceAsset + /// Get a NamespaceDevice /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// The name of the namespace. - /// The name of the asset. + /// The name of the device. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). @@ -9014,9 +8802,9 @@ public partial class DeviceRegistry /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task NamespaceAssetsGet(string subscriptionId, string resourceGroupName, string namespaceName, string assetName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task NamespaceDevicesGet(string subscriptionId, string resourceGroupName, string namespaceName, string deviceName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -9028,8 +8816,8 @@ public partial class DeviceRegistry + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.DeviceRegistry/namespaces/" + global::System.Uri.EscapeDataString(namespaceName) - + "/assets/" - + global::System.Uri.EscapeDataString(assetName) + + "/devices/" + + global::System.Uri.EscapeDataString(deviceName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -9043,11 +8831,11 @@ public partial class DeviceRegistry await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.NamespaceAssetsGet_Call (request, onOk,onDefault,eventListener,sender); + await this.NamespaceDevicesGet_Call (request, onOk,onDefault,eventListener,sender); } } - /// Get a NamespaceAsset + /// Get a NamespaceDevice /// /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled @@ -9057,25 +8845,25 @@ public partial class DeviceRegistry /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task NamespaceAssetsGetViaIdentity(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.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task NamespaceDevicesGetViaIdentity(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.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.DeviceRegistry/namespaces/(?[^/]+)/assets/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.DeviceRegistry/namespaces/(?[^/]+)/devices/(?[^/]+)$", 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.DeviceRegistry/namespaces/{namespaceName}/assets/{assetName}'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/devices/{deviceName}'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; var namespaceName = _match.Groups["namespaceName"].Value; - var assetName = _match.Groups["assetName"].Value; + var deviceName = _match.Groups["deviceName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" @@ -9084,8 +8872,8 @@ public partial class DeviceRegistry + resourceGroupName + "/providers/Microsoft.DeviceRegistry/namespaces/" + namespaceName - + "/assets/" - + assetName + + "/devices/" + + deviceName + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -9099,37 +8887,37 @@ public partial class DeviceRegistry await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.NamespaceAssetsGet_Call (request, onOk,onDefault,eventListener,sender); + await this.NamespaceDevicesGet_Call (request, onOk,onDefault,eventListener,sender); } } - /// Get a NamespaceAsset + /// Get a NamespaceDevice /// /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync pipeline to use to make the request. /// - /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task NamespaceAssetsGetViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task NamespaceDevicesGetViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.DeviceRegistry/namespaces/(?[^/]+)/assets/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.DeviceRegistry/namespaces/(?[^/]+)/devices/(?[^/]+)$", 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.DeviceRegistry/namespaces/{namespaceName}/assets/{assetName}'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/devices/{deviceName}'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; var namespaceName = _match.Groups["namespaceName"].Value; - var assetName = _match.Groups["assetName"].Value; + var deviceName = _match.Groups["deviceName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" @@ -9138,8 +8926,8 @@ public partial class DeviceRegistry + resourceGroupName + "/providers/Microsoft.DeviceRegistry/namespaces/" + namespaceName - + "/assets/" - + assetName + + "/devices/" + + deviceName + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -9153,24 +8941,24 @@ public partial class DeviceRegistry await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - return await this.NamespaceAssetsGetWithResult_Call (request, eventListener,sender); + return await this.NamespaceDevicesGetWithResult_Call (request, eventListener,sender); } } - /// Get a NamespaceAsset + /// Get a NamespaceDevice /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// The name of the namespace. - /// The name of the asset. + /// The name of the device. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync pipeline to use to make the request. /// - /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task NamespaceAssetsGetWithResult(string subscriptionId, string resourceGroupName, string namespaceName, string assetName, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task NamespaceDevicesGetWithResult(string subscriptionId, string resourceGroupName, string namespaceName, string deviceName, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -9182,8 +8970,8 @@ public partial class DeviceRegistry + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.DeviceRegistry/namespaces/" + global::System.Uri.EscapeDataString(namespaceName) - + "/assets/" - + global::System.Uri.EscapeDataString(assetName) + + "/devices/" + + global::System.Uri.EscapeDataString(deviceName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -9197,19 +8985,19 @@ public partial class DeviceRegistry await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - return await this.NamespaceAssetsGetWithResult_Call (request, eventListener,sender); + return await this.NamespaceDevicesGetWithResult_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.DeviceRegistry.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 NamespaceAssetsGetWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task NamespaceDevicesGetWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -9228,7 +9016,7 @@ public partial class DeviceRegistry case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.NamespaceAsset.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode.Parse(body.Result)) ); + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.NamespaceDevice.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode.Parse(body.Result)) ); return await _result; } default: @@ -9261,7 +9049,7 @@ public partial class DeviceRegistry } } - /// 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 @@ -9271,7 +9059,7 @@ public partial class DeviceRegistry /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task NamespaceAssetsGet_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.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task NamespaceDevicesGet_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.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -9290,7 +9078,7 @@ public partial class DeviceRegistry case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.NamespaceAsset.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.NamespaceDevice.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: @@ -9312,18 +9100,18 @@ public partial class DeviceRegistry } /// - /// 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 value must be an UUID. /// The name of the resource group. The name is case insensitive. /// The name of the namespace. - /// The name of the asset. + /// The name of the device. /// 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 NamespaceAssetsGet_Validate(string subscriptionId, string resourceGroupName, string namespaceName, string assetName, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task NamespaceDevicesGet_Validate(string subscriptionId, string resourceGroupName, string namespaceName, string deviceName, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -9336,14 +9124,14 @@ public partial class DeviceRegistry await eventListener.AssertMinimumLength(nameof(namespaceName),namespaceName,3); await eventListener.AssertMaximumLength(nameof(namespaceName),namespaceName,64); await eventListener.AssertRegEx(nameof(namespaceName), namespaceName, @"^[a-z0-9][a-z0-9-]*[a-z0-9]$"); - await eventListener.AssertNotNull(nameof(assetName),assetName); - await eventListener.AssertMinimumLength(nameof(assetName),assetName,3); - await eventListener.AssertMaximumLength(nameof(assetName),assetName,63); - await eventListener.AssertRegEx(nameof(assetName), assetName, @"^[a-z0-9][a-z0-9-]*[a-z0-9]$"); - } - } + await eventListener.AssertNotNull(nameof(deviceName),deviceName); + await eventListener.AssertMinimumLength(nameof(deviceName),deviceName,3); + await eventListener.AssertMaximumLength(nameof(deviceName),deviceName,63); + await eventListener.AssertRegEx(nameof(deviceName), deviceName, @"^[0-9a-zA-Z][a-zA-Z0-9-]*$"); + } + } - /// List NamespaceAsset resources by Namespace + /// List NamespaceDevice resources by Namespace /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// The name of the namespace. @@ -9355,9 +9143,9 @@ public partial class DeviceRegistry /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task NamespaceAssetsListByResourceGroup(string subscriptionId, string resourceGroupName, string namespaceName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task NamespaceDevicesListByResourceGroup(string subscriptionId, string resourceGroupName, string namespaceName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -9369,7 +9157,7 @@ public partial class DeviceRegistry + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.DeviceRegistry/namespaces/" + global::System.Uri.EscapeDataString(namespaceName) - + "/assets" + + "/devices" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -9383,11 +9171,11 @@ public partial class DeviceRegistry await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.NamespaceAssetsListByResourceGroup_Call (request, onOk,onDefault,eventListener,sender); + await this.NamespaceDevicesListByResourceGroup_Call (request, onOk,onDefault,eventListener,sender); } } - /// List NamespaceAsset resources by Namespace + /// List NamespaceDevice resources by Namespace /// /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled @@ -9397,18 +9185,18 @@ public partial class DeviceRegistry /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task NamespaceAssetsListByResourceGroupViaIdentity(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.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task NamespaceDevicesListByResourceGroupViaIdentity(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.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.DeviceRegistry/namespaces/(?[^/]+)/assets$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.DeviceRegistry/namespaces/(?[^/]+)/devices$", 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.DeviceRegistry/namespaces/{namespaceName}/assets'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/devices'"); } // replace URI parameters with values from identity @@ -9423,7 +9211,7 @@ public partial class DeviceRegistry + resourceGroupName + "/providers/Microsoft.DeviceRegistry/namespaces/" + namespaceName - + "/assets" + + "/devices" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -9437,30 +9225,30 @@ public partial class DeviceRegistry await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.NamespaceAssetsListByResourceGroup_Call (request, onOk,onDefault,eventListener,sender); + await this.NamespaceDevicesListByResourceGroup_Call (request, onOk,onDefault,eventListener,sender); } } - /// List NamespaceAsset resources by Namespace + /// List NamespaceDevice resources by Namespace /// /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync pipeline to use to make the request. /// - /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task NamespaceAssetsListByResourceGroupViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task NamespaceDevicesListByResourceGroupViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.DeviceRegistry/namespaces/(?[^/]+)/assets$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.DeviceRegistry/namespaces/(?[^/]+)/devices$", 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.DeviceRegistry/namespaces/{namespaceName}/assets'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/devices'"); } // replace URI parameters with values from identity @@ -9475,7 +9263,7 @@ public partial class DeviceRegistry + resourceGroupName + "/providers/Microsoft.DeviceRegistry/namespaces/" + namespaceName - + "/assets" + + "/devices" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -9489,23 +9277,23 @@ public partial class DeviceRegistry await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - return await this.NamespaceAssetsListByResourceGroupWithResult_Call (request, eventListener,sender); + return await this.NamespaceDevicesListByResourceGroupWithResult_Call (request, eventListener,sender); } } - /// List NamespaceAsset resources by Namespace + /// List NamespaceDevice resources by Namespace /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// The name of the namespace. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync pipeline to use to make the request. /// - /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task NamespaceAssetsListByResourceGroupWithResult(string subscriptionId, string resourceGroupName, string namespaceName, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task NamespaceDevicesListByResourceGroupWithResult(string subscriptionId, string resourceGroupName, string namespaceName, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -9517,7 +9305,7 @@ public partial class DeviceRegistry + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.DeviceRegistry/namespaces/" + global::System.Uri.EscapeDataString(namespaceName) - + "/assets" + + "/devices" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -9531,21 +9319,21 @@ public partial class DeviceRegistry await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - return await this.NamespaceAssetsListByResourceGroupWithResult_Call (request, eventListener,sender); + return await this.NamespaceDevicesListByResourceGroupWithResult_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.DeviceRegistry.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 NamespaceAssetsListByResourceGroupWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task NamespaceDevicesListByResourceGroupWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -9564,7 +9352,7 @@ public partial class DeviceRegistry case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.NamespaceAssetListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode.Parse(body.Result)) ); + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.NamespaceDeviceListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode.Parse(body.Result)) ); return await _result; } default: @@ -9597,7 +9385,9 @@ public partial class DeviceRegistry } } - /// 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 @@ -9607,7 +9397,7 @@ public partial class DeviceRegistry /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task NamespaceAssetsListByResourceGroup_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.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task NamespaceDevicesListByResourceGroup_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.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -9626,7 +9416,7 @@ public partial class DeviceRegistry case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.NamespaceAssetListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.NamespaceDeviceListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: @@ -9648,7 +9438,7 @@ public partial class DeviceRegistry } /// - /// Validation method for method. Call this like the actual call, but you + /// Validation method for method. Call this like the actual call, but you /// will get validation events back. /// /// The ID of the target subscription. The value must be an UUID. @@ -9658,7 +9448,7 @@ public partial class DeviceRegistry /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task NamespaceAssetsListByResourceGroup_Validate(string subscriptionId, string resourceGroupName, string namespaceName, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task NamespaceDevicesListByResourceGroup_Validate(string subscriptionId, string resourceGroupName, string namespaceName, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -9674,11 +9464,11 @@ public partial class DeviceRegistry } } - /// update a NamespaceAsset + /// update a NamespaceDevice /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// The name of the namespace. - /// The name of the asset. + /// The name of the device. /// The resource properties to be updated. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled @@ -9689,9 +9479,9 @@ public partial class DeviceRegistry /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task NamespaceAssetsUpdate(string subscriptionId, string resourceGroupName, string namespaceName, string assetName, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceAssetUpdate body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeUpdate) + public async global::System.Threading.Tasks.Task NamespaceDevicesUpdate(string subscriptionId, string resourceGroupName, string namespaceName, string deviceName, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDeviceUpdate body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -9703,8 +9493,8 @@ public partial class DeviceRegistry + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.DeviceRegistry/namespaces/" + global::System.Uri.EscapeDataString(namespaceName) - + "/assets/" - + global::System.Uri.EscapeDataString(assetName) + + "/devices/" + + global::System.Uri.EscapeDataString(deviceName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -9722,11 +9512,11 @@ public partial class DeviceRegistry request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.NamespaceAssetsUpdate_Call (request, onOk,onDefault,eventListener,sender); + await this.NamespaceDevicesUpdate_Call (request, onOk,onDefault,eventListener,sender); } } - /// update a NamespaceAsset + /// update a NamespaceDevice /// /// The resource properties to be updated. /// a delegate that is called when the remote service returns 200 (OK). @@ -9738,25 +9528,25 @@ public partial class DeviceRegistry /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task NamespaceAssetsUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceAssetUpdate body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeUpdate) + public async global::System.Threading.Tasks.Task NamespaceDevicesUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDeviceUpdate body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.DeviceRegistry/namespaces/(?[^/]+)/assets/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.DeviceRegistry/namespaces/(?[^/]+)/devices/(?[^/]+)$", 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.DeviceRegistry/namespaces/{namespaceName}/assets/{assetName}'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/devices/{deviceName}'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; var namespaceName = _match.Groups["namespaceName"].Value; - var assetName = _match.Groups["assetName"].Value; + var deviceName = _match.Groups["deviceName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" @@ -9765,8 +9555,8 @@ public partial class DeviceRegistry + resourceGroupName + "/providers/Microsoft.DeviceRegistry/namespaces/" + namespaceName - + "/assets/" - + assetName + + "/devices/" + + deviceName + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -9784,39 +9574,39 @@ public partial class DeviceRegistry request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.NamespaceAssetsUpdate_Call (request, onOk,onDefault,eventListener,sender); + await this.NamespaceDevicesUpdate_Call (request, onOk,onDefault,eventListener,sender); } } - /// update a NamespaceAsset + /// update a NamespaceDevice /// /// The resource properties to be updated. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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 NamespaceAssetsUpdateViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceAssetUpdate body, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeUpdate) + public async global::System.Threading.Tasks.Task NamespaceDevicesUpdateViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDeviceUpdate body, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.DeviceRegistry/namespaces/(?[^/]+)/assets/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.DeviceRegistry/namespaces/(?[^/]+)/devices/(?[^/]+)$", 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.DeviceRegistry/namespaces/{namespaceName}/assets/{assetName}'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/devices/{deviceName}'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; var namespaceName = _match.Groups["namespaceName"].Value; - var assetName = _match.Groups["assetName"].Value; + var deviceName = _match.Groups["deviceName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" @@ -9825,8 +9615,8 @@ public partial class DeviceRegistry + resourceGroupName + "/providers/Microsoft.DeviceRegistry/namespaces/" + namespaceName - + "/assets/" - + assetName + + "/devices/" + + deviceName + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -9844,16 +9634,16 @@ public partial class DeviceRegistry request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - return await this.NamespaceAssetsUpdateWithResult_Call (request, eventListener,sender); + return await this.NamespaceDevicesUpdateWithResult_Call (request, eventListener,sender); } } - /// update a NamespaceAsset + /// update a NamespaceDevice /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// The name of the namespace. - /// The name of the asset. - /// Json string supplied to the NamespaceAssetsUpdate operation + /// The name of the device. + /// Json string supplied to the NamespaceDevicesUpdate 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). @@ -9862,9 +9652,9 @@ public partial class DeviceRegistry /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task NamespaceAssetsUpdateViaJsonString(string subscriptionId, string resourceGroupName, string namespaceName, string assetName, 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.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task NamespaceDevicesUpdateViaJsonString(string subscriptionId, string resourceGroupName, string namespaceName, string deviceName, 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.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -9876,8 +9666,8 @@ public partial class DeviceRegistry + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.DeviceRegistry/namespaces/" + global::System.Uri.EscapeDataString(namespaceName) - + "/assets/" - + global::System.Uri.EscapeDataString(assetName) + + "/devices/" + + global::System.Uri.EscapeDataString(deviceName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -9895,25 +9685,25 @@ public partial class DeviceRegistry request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.NamespaceAssetsUpdate_Call (request, onOk,onDefault,eventListener,sender); + await this.NamespaceDevicesUpdate_Call (request, onOk,onDefault,eventListener,sender); } } - /// update a NamespaceAsset + /// update a NamespaceDevice /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// The name of the namespace. - /// The name of the asset. - /// Json string supplied to the NamespaceAssetsUpdate operation + /// The name of the device. + /// Json string supplied to the NamespaceDevicesUpdate operation /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync pipeline to use to make the request. /// - /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task NamespaceAssetsUpdateViaJsonStringWithResult(string subscriptionId, string resourceGroupName, string namespaceName, string assetName, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task NamespaceDevicesUpdateViaJsonStringWithResult(string subscriptionId, string resourceGroupName, string namespaceName, string deviceName, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -9925,8 +9715,8 @@ public partial class DeviceRegistry + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.DeviceRegistry/namespaces/" + global::System.Uri.EscapeDataString(namespaceName) - + "/assets/" - + global::System.Uri.EscapeDataString(assetName) + + "/devices/" + + global::System.Uri.EscapeDataString(deviceName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -9944,26 +9734,26 @@ public partial class DeviceRegistry request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - return await this.NamespaceAssetsUpdateWithResult_Call (request, eventListener,sender); + return await this.NamespaceDevicesUpdateWithResult_Call (request, eventListener,sender); } } - /// update a NamespaceAsset + /// update a NamespaceDevice /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// The name of the namespace. - /// The name of the asset. + /// The name of the device. /// The resource properties to be updated. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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 NamespaceAssetsUpdateWithResult(string subscriptionId, string resourceGroupName, string namespaceName, string assetName, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceAssetUpdate body, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeUpdate) + public async global::System.Threading.Tasks.Task NamespaceDevicesUpdateWithResult(string subscriptionId, string resourceGroupName, string namespaceName, string deviceName, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDeviceUpdate body, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -9975,8 +9765,8 @@ public partial class DeviceRegistry + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.DeviceRegistry/namespaces/" + global::System.Uri.EscapeDataString(namespaceName) - + "/assets/" - + global::System.Uri.EscapeDataString(assetName) + + "/devices/" + + global::System.Uri.EscapeDataString(deviceName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -9994,19 +9784,19 @@ public partial class DeviceRegistry request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - return await this.NamespaceAssetsUpdateWithResult_Call (request, eventListener,sender); + return await this.NamespaceDevicesUpdateWithResult_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.DeviceRegistry.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 NamespaceAssetsUpdateWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task NamespaceDevicesUpdateWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -10118,7 +9908,7 @@ public partial class DeviceRegistry case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.NamespaceAsset.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode.Parse(body.Result)) ); + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.NamespaceDevice.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode.Parse(body.Result)) ); return await _result; } default: @@ -10151,7 +9941,7 @@ public partial class DeviceRegistry } } - /// 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 @@ -10161,7 +9951,7 @@ public partial class DeviceRegistry /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task NamespaceAssetsUpdate_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.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task NamespaceDevicesUpdate_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.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -10273,7 +10063,7 @@ public partial class DeviceRegistry case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.NamespaceAsset.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.NamespaceDevice.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: @@ -10295,19 +10085,19 @@ public partial class DeviceRegistry } /// - /// 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 value must be an UUID. /// The name of the resource group. The name is case insensitive. /// The name of the namespace. - /// The name of the asset. + /// The name of the device. /// The resource properties to be updated. /// 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 NamespaceAssetsUpdate_Validate(string subscriptionId, string resourceGroupName, string namespaceName, string assetName, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceAssetUpdate body, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task NamespaceDevicesUpdate_Validate(string subscriptionId, string resourceGroupName, string namespaceName, string deviceName, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDeviceUpdate body, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -10320,20 +10110,20 @@ public partial class DeviceRegistry await eventListener.AssertMinimumLength(nameof(namespaceName),namespaceName,3); await eventListener.AssertMaximumLength(nameof(namespaceName),namespaceName,64); await eventListener.AssertRegEx(nameof(namespaceName), namespaceName, @"^[a-z0-9][a-z0-9-]*[a-z0-9]$"); - await eventListener.AssertNotNull(nameof(assetName),assetName); - await eventListener.AssertMinimumLength(nameof(assetName),assetName,3); - await eventListener.AssertMaximumLength(nameof(assetName),assetName,63); - await eventListener.AssertRegEx(nameof(assetName), assetName, @"^[a-z0-9][a-z0-9-]*[a-z0-9]$"); + await eventListener.AssertNotNull(nameof(deviceName),deviceName); + await eventListener.AssertMinimumLength(nameof(deviceName),deviceName,3); + await eventListener.AssertMaximumLength(nameof(deviceName),deviceName,63); + await eventListener.AssertRegEx(nameof(deviceName), deviceName, @"^[0-9a-zA-Z][a-zA-Z0-9-]*$"); await eventListener.AssertNotNull(nameof(body), body); await eventListener.AssertObjectIsValid(nameof(body), body); } } - /// replace a NamespaceDevice + /// replace a NamespaceDiscoveredAsset /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// The name of the namespace. - /// The name of the device. + /// The name of the discovered asset. /// Resource create parameters. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled @@ -10344,9 +10134,9 @@ public partial class DeviceRegistry /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task NamespaceDevicesCreateOrReplace(string subscriptionId, string resourceGroupName, string namespaceName, string deviceName, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDevice body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeUpdate) + public async global::System.Threading.Tasks.Task NamespaceDiscoveredAssetsCreateOrReplace(string subscriptionId, string resourceGroupName, string namespaceName, string discoveredAssetName, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDiscoveredAsset body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -10358,8 +10148,8 @@ public partial class DeviceRegistry + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.DeviceRegistry/namespaces/" + global::System.Uri.EscapeDataString(namespaceName) - + "/devices/" - + global::System.Uri.EscapeDataString(deviceName) + + "/discoveredAssets/" + + global::System.Uri.EscapeDataString(discoveredAssetName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -10377,11 +10167,11 @@ public partial class DeviceRegistry request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.NamespaceDevicesCreateOrReplace_Call (request, onOk,onDefault,eventListener,sender); + await this.NamespaceDiscoveredAssetsCreateOrReplace_Call (request, onOk,onDefault,eventListener,sender); } } - /// replace a NamespaceDevice + /// replace a NamespaceDiscoveredAsset /// /// Resource create parameters. /// a delegate that is called when the remote service returns 200 (OK). @@ -10393,25 +10183,25 @@ public partial class DeviceRegistry /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task NamespaceDevicesCreateOrReplaceViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDevice body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeUpdate) + public async global::System.Threading.Tasks.Task NamespaceDiscoveredAssetsCreateOrReplaceViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDiscoveredAsset body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.DeviceRegistry/namespaces/(?[^/]+)/devices/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.DeviceRegistry/namespaces/(?[^/]+)/discoveredAssets/(?[^/]+)$", 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.DeviceRegistry/namespaces/{namespaceName}/devices/{deviceName}'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/discoveredAssets/{discoveredAssetName}'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; var namespaceName = _match.Groups["namespaceName"].Value; - var deviceName = _match.Groups["deviceName"].Value; + var discoveredAssetName = _match.Groups["discoveredAssetName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" @@ -10420,8 +10210,8 @@ public partial class DeviceRegistry + resourceGroupName + "/providers/Microsoft.DeviceRegistry/namespaces/" + namespaceName - + "/devices/" - + deviceName + + "/discoveredAssets/" + + discoveredAssetName + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -10439,39 +10229,39 @@ public partial class DeviceRegistry request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.NamespaceDevicesCreateOrReplace_Call (request, onOk,onDefault,eventListener,sender); + await this.NamespaceDiscoveredAssetsCreateOrReplace_Call (request, onOk,onDefault,eventListener,sender); } } - /// replace a NamespaceDevice + /// replace a NamespaceDiscoveredAsset /// /// Resource create parameters. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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 NamespaceDevicesCreateOrReplaceViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDevice body, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeUpdate) + public async global::System.Threading.Tasks.Task NamespaceDiscoveredAssetsCreateOrReplaceViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDiscoveredAsset body, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.DeviceRegistry/namespaces/(?[^/]+)/devices/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.DeviceRegistry/namespaces/(?[^/]+)/discoveredAssets/(?[^/]+)$", 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.DeviceRegistry/namespaces/{namespaceName}/devices/{deviceName}'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/discoveredAssets/{discoveredAssetName}'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; var namespaceName = _match.Groups["namespaceName"].Value; - var deviceName = _match.Groups["deviceName"].Value; + var discoveredAssetName = _match.Groups["discoveredAssetName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" @@ -10480,8 +10270,8 @@ public partial class DeviceRegistry + resourceGroupName + "/providers/Microsoft.DeviceRegistry/namespaces/" + namespaceName - + "/devices/" - + deviceName + + "/discoveredAssets/" + + discoveredAssetName + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -10499,16 +10289,16 @@ public partial class DeviceRegistry request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - return await this.NamespaceDevicesCreateOrReplaceWithResult_Call (request, eventListener,sender); + return await this.NamespaceDiscoveredAssetsCreateOrReplaceWithResult_Call (request, eventListener,sender); } } - /// replace a NamespaceDevice + /// replace a NamespaceDiscoveredAsset /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// The name of the namespace. - /// The name of the device. - /// Json string supplied to the NamespaceDevicesCreateOrReplace operation + /// The name of the discovered asset. + /// Json string supplied to the NamespaceDiscoveredAssetsCreateOrReplace 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). @@ -10517,9 +10307,9 @@ public partial class DeviceRegistry /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task NamespaceDevicesCreateOrReplaceViaJsonString(string subscriptionId, string resourceGroupName, string namespaceName, string deviceName, 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.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task NamespaceDiscoveredAssetsCreateOrReplaceViaJsonString(string subscriptionId, string resourceGroupName, string namespaceName, string discoveredAssetName, 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.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -10531,8 +10321,8 @@ public partial class DeviceRegistry + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.DeviceRegistry/namespaces/" + global::System.Uri.EscapeDataString(namespaceName) - + "/devices/" - + global::System.Uri.EscapeDataString(deviceName) + + "/discoveredAssets/" + + global::System.Uri.EscapeDataString(discoveredAssetName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -10550,25 +10340,25 @@ public partial class DeviceRegistry request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.NamespaceDevicesCreateOrReplace_Call (request, onOk,onDefault,eventListener,sender); + await this.NamespaceDiscoveredAssetsCreateOrReplace_Call (request, onOk,onDefault,eventListener,sender); } } - /// replace a NamespaceDevice + /// replace a NamespaceDiscoveredAsset /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// The name of the namespace. - /// The name of the device. - /// Json string supplied to the NamespaceDevicesCreateOrReplace operation + /// The name of the discovered asset. + /// Json string supplied to the NamespaceDiscoveredAssetsCreateOrReplace operation /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync pipeline to use to make the request. /// - /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task NamespaceDevicesCreateOrReplaceViaJsonStringWithResult(string subscriptionId, string resourceGroupName, string namespaceName, string deviceName, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task NamespaceDiscoveredAssetsCreateOrReplaceViaJsonStringWithResult(string subscriptionId, string resourceGroupName, string namespaceName, string discoveredAssetName, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -10580,8 +10370,8 @@ public partial class DeviceRegistry + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.DeviceRegistry/namespaces/" + global::System.Uri.EscapeDataString(namespaceName) - + "/devices/" - + global::System.Uri.EscapeDataString(deviceName) + + "/discoveredAssets/" + + global::System.Uri.EscapeDataString(discoveredAssetName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -10599,26 +10389,26 @@ public partial class DeviceRegistry request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - return await this.NamespaceDevicesCreateOrReplaceWithResult_Call (request, eventListener,sender); + return await this.NamespaceDiscoveredAssetsCreateOrReplaceWithResult_Call (request, eventListener,sender); } } - /// replace a NamespaceDevice + /// replace a NamespaceDiscoveredAsset /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// The name of the namespace. - /// The name of the device. + /// The name of the discovered asset. /// Resource create parameters. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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 NamespaceDevicesCreateOrReplaceWithResult(string subscriptionId, string resourceGroupName, string namespaceName, string deviceName, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDevice body, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeUpdate) + public async global::System.Threading.Tasks.Task NamespaceDiscoveredAssetsCreateOrReplaceWithResult(string subscriptionId, string resourceGroupName, string namespaceName, string discoveredAssetName, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDiscoveredAsset body, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -10630,8 +10420,8 @@ public partial class DeviceRegistry + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.DeviceRegistry/namespaces/" + global::System.Uri.EscapeDataString(namespaceName) - + "/devices/" - + global::System.Uri.EscapeDataString(deviceName) + + "/discoveredAssets/" + + global::System.Uri.EscapeDataString(discoveredAssetName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -10649,21 +10439,21 @@ public partial class DeviceRegistry request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - return await this.NamespaceDevicesCreateOrReplaceWithResult_Call (request, eventListener,sender); + return await this.NamespaceDiscoveredAssetsCreateOrReplaceWithResult_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.DeviceRegistry.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 NamespaceDevicesCreateOrReplaceWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task NamespaceDiscoveredAssetsCreateOrReplaceWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -10774,7 +10564,7 @@ public partial class DeviceRegistry case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.NamespaceDevice.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode.Parse(body.Result)) ); + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.NamespaceDiscoveredAsset.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode.Parse(body.Result)) ); return await _result; } default: @@ -10807,7 +10597,9 @@ public partial class DeviceRegistry } } - /// 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 @@ -10817,7 +10609,7 @@ public partial class DeviceRegistry /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task NamespaceDevicesCreateOrReplace_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.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task NamespaceDiscoveredAssetsCreateOrReplace_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.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -10928,7 +10720,7 @@ public partial class DeviceRegistry case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.NamespaceDevice.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.NamespaceDiscoveredAsset.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: @@ -10950,19 +10742,19 @@ public partial class DeviceRegistry } /// - /// 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 value must be an UUID. /// The name of the resource group. The name is case insensitive. /// The name of the namespace. - /// The name of the device. + /// The name of the discovered asset. /// Resource create parameters. /// 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 NamespaceDevicesCreateOrReplace_Validate(string subscriptionId, string resourceGroupName, string namespaceName, string deviceName, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDevice body, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task NamespaceDiscoveredAssetsCreateOrReplace_Validate(string subscriptionId, string resourceGroupName, string namespaceName, string discoveredAssetName, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDiscoveredAsset body, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -10975,20 +10767,20 @@ public partial class DeviceRegistry await eventListener.AssertMinimumLength(nameof(namespaceName),namespaceName,3); await eventListener.AssertMaximumLength(nameof(namespaceName),namespaceName,64); await eventListener.AssertRegEx(nameof(namespaceName), namespaceName, @"^[a-z0-9][a-z0-9-]*[a-z0-9]$"); - await eventListener.AssertNotNull(nameof(deviceName),deviceName); - await eventListener.AssertMinimumLength(nameof(deviceName),deviceName,3); - await eventListener.AssertMaximumLength(nameof(deviceName),deviceName,63); - await eventListener.AssertRegEx(nameof(deviceName), deviceName, @"^[0-9a-zA-Z][a-zA-Z0-9-]*$"); + await eventListener.AssertNotNull(nameof(discoveredAssetName),discoveredAssetName); + await eventListener.AssertMinimumLength(nameof(discoveredAssetName),discoveredAssetName,3); + await eventListener.AssertMaximumLength(nameof(discoveredAssetName),discoveredAssetName,63); + await eventListener.AssertRegEx(nameof(discoveredAssetName), discoveredAssetName, @"^[a-z0-9][a-z0-9-]*[a-z0-9]$"); await eventListener.AssertNotNull(nameof(body), body); await eventListener.AssertObjectIsValid(nameof(body), body); } } - /// Delete a NamespaceDevice + /// Delete a NamespaceDiscoveredAsset /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// The name of the namespace. - /// The name of the device. + /// The name of the discovered asset. /// 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 @@ -10998,9 +10790,9 @@ public partial class DeviceRegistry /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task NamespaceDevicesDelete(string subscriptionId, string resourceGroupName, string namespaceName, string deviceName, global::System.Func onNoContent, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task NamespaceDiscoveredAssetsDelete(string subscriptionId, string resourceGroupName, string namespaceName, string discoveredAssetName, global::System.Func onNoContent, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -11012,8 +10804,8 @@ public partial class DeviceRegistry + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.DeviceRegistry/namespaces/" + global::System.Uri.EscapeDataString(namespaceName) - + "/devices/" - + global::System.Uri.EscapeDataString(deviceName) + + "/discoveredAssets/" + + global::System.Uri.EscapeDataString(discoveredAssetName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -11027,11 +10819,11 @@ public partial class DeviceRegistry await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.NamespaceDevicesDelete_Call (request, onNoContent,onOk,onDefault,eventListener,sender); + await this.NamespaceDiscoveredAssetsDelete_Call (request, onNoContent,onOk,onDefault,eventListener,sender); } } - /// Delete a NamespaceDevice + /// Delete a NamespaceDiscoveredAsset /// /// a delegate that is called when the remote service returns 204 (NoContent). /// a delegate that is called when the remote service returns 200 (OK). @@ -11042,25 +10834,25 @@ public partial class DeviceRegistry /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task NamespaceDevicesDeleteViaIdentity(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.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task NamespaceDiscoveredAssetsDeleteViaIdentity(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.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.DeviceRegistry/namespaces/(?[^/]+)/devices/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.DeviceRegistry/namespaces/(?[^/]+)/discoveredAssets/(?[^/]+)$", 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.DeviceRegistry/namespaces/{namespaceName}/devices/{deviceName}'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/discoveredAssets/{discoveredAssetName}'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; var namespaceName = _match.Groups["namespaceName"].Value; - var deviceName = _match.Groups["deviceName"].Value; + var discoveredAssetName = _match.Groups["discoveredAssetName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" @@ -11069,8 +10861,8 @@ public partial class DeviceRegistry + resourceGroupName + "/providers/Microsoft.DeviceRegistry/namespaces/" + namespaceName - + "/devices/" - + deviceName + + "/discoveredAssets/" + + discoveredAssetName + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -11084,11 +10876,11 @@ public partial class DeviceRegistry await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.NamespaceDevicesDelete_Call (request, onNoContent,onOk,onDefault,eventListener,sender); + await this.NamespaceDiscoveredAssetsDelete_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). @@ -11099,7 +10891,7 @@ public partial class DeviceRegistry /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task NamespaceDevicesDelete_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.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task NamespaceDiscoveredAssetsDelete_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.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -11239,18 +11031,18 @@ public partial class DeviceRegistry } /// - /// 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 value must be an UUID. /// The name of the resource group. The name is case insensitive. /// The name of the namespace. - /// The name of the device. + /// The name of the discovered asset. /// 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 NamespaceDevicesDelete_Validate(string subscriptionId, string resourceGroupName, string namespaceName, string deviceName, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task NamespaceDiscoveredAssetsDelete_Validate(string subscriptionId, string resourceGroupName, string namespaceName, string discoveredAssetName, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -11263,18 +11055,18 @@ public partial class DeviceRegistry await eventListener.AssertMinimumLength(nameof(namespaceName),namespaceName,3); await eventListener.AssertMaximumLength(nameof(namespaceName),namespaceName,64); await eventListener.AssertRegEx(nameof(namespaceName), namespaceName, @"^[a-z0-9][a-z0-9-]*[a-z0-9]$"); - await eventListener.AssertNotNull(nameof(deviceName),deviceName); - await eventListener.AssertMinimumLength(nameof(deviceName),deviceName,3); - await eventListener.AssertMaximumLength(nameof(deviceName),deviceName,63); - await eventListener.AssertRegEx(nameof(deviceName), deviceName, @"^[0-9a-zA-Z][a-zA-Z0-9-]*$"); + await eventListener.AssertNotNull(nameof(discoveredAssetName),discoveredAssetName); + await eventListener.AssertMinimumLength(nameof(discoveredAssetName),discoveredAssetName,3); + await eventListener.AssertMaximumLength(nameof(discoveredAssetName),discoveredAssetName,63); + await eventListener.AssertRegEx(nameof(discoveredAssetName), discoveredAssetName, @"^[a-z0-9][a-z0-9-]*[a-z0-9]$"); } } - /// Get a NamespaceDevice + /// Get a NamespaceDiscoveredAsset /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// The name of the namespace. - /// The name of the device. + /// The name of the discovered asset. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). @@ -11283,9 +11075,9 @@ public partial class DeviceRegistry /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task NamespaceDevicesGet(string subscriptionId, string resourceGroupName, string namespaceName, string deviceName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task NamespaceDiscoveredAssetsGet(string subscriptionId, string resourceGroupName, string namespaceName, string discoveredAssetName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -11297,8 +11089,8 @@ public partial class DeviceRegistry + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.DeviceRegistry/namespaces/" + global::System.Uri.EscapeDataString(namespaceName) - + "/devices/" - + global::System.Uri.EscapeDataString(deviceName) + + "/discoveredAssets/" + + global::System.Uri.EscapeDataString(discoveredAssetName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -11312,11 +11104,11 @@ public partial class DeviceRegistry await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.NamespaceDevicesGet_Call (request, onOk,onDefault,eventListener,sender); + await this.NamespaceDiscoveredAssetsGet_Call (request, onOk,onDefault,eventListener,sender); } } - /// Get a NamespaceDevice + /// Get a NamespaceDiscoveredAsset /// /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled @@ -11326,25 +11118,25 @@ public partial class DeviceRegistry /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task NamespaceDevicesGetViaIdentity(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.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task NamespaceDiscoveredAssetsGetViaIdentity(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.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.DeviceRegistry/namespaces/(?[^/]+)/devices/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.DeviceRegistry/namespaces/(?[^/]+)/discoveredAssets/(?[^/]+)$", 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.DeviceRegistry/namespaces/{namespaceName}/devices/{deviceName}'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/discoveredAssets/{discoveredAssetName}'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; var namespaceName = _match.Groups["namespaceName"].Value; - var deviceName = _match.Groups["deviceName"].Value; + var discoveredAssetName = _match.Groups["discoveredAssetName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" @@ -11353,8 +11145,8 @@ public partial class DeviceRegistry + resourceGroupName + "/providers/Microsoft.DeviceRegistry/namespaces/" + namespaceName - + "/devices/" - + deviceName + + "/discoveredAssets/" + + discoveredAssetName + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -11368,37 +11160,37 @@ public partial class DeviceRegistry await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.NamespaceDevicesGet_Call (request, onOk,onDefault,eventListener,sender); + await this.NamespaceDiscoveredAssetsGet_Call (request, onOk,onDefault,eventListener,sender); } } - /// Get a NamespaceDevice + /// Get a NamespaceDiscoveredAsset /// /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync pipeline to use to make the request. /// - /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task NamespaceDevicesGetViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task NamespaceDiscoveredAssetsGetViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.DeviceRegistry/namespaces/(?[^/]+)/devices/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.DeviceRegistry/namespaces/(?[^/]+)/discoveredAssets/(?[^/]+)$", 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.DeviceRegistry/namespaces/{namespaceName}/devices/{deviceName}'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/discoveredAssets/{discoveredAssetName}'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; var namespaceName = _match.Groups["namespaceName"].Value; - var deviceName = _match.Groups["deviceName"].Value; + var discoveredAssetName = _match.Groups["discoveredAssetName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" @@ -11407,8 +11199,8 @@ public partial class DeviceRegistry + resourceGroupName + "/providers/Microsoft.DeviceRegistry/namespaces/" + namespaceName - + "/devices/" - + deviceName + + "/discoveredAssets/" + + discoveredAssetName + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -11422,24 +11214,24 @@ public partial class DeviceRegistry await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - return await this.NamespaceDevicesGetWithResult_Call (request, eventListener,sender); + return await this.NamespaceDiscoveredAssetsGetWithResult_Call (request, eventListener,sender); } } - /// Get a NamespaceDevice + /// Get a NamespaceDiscoveredAsset /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// The name of the namespace. - /// The name of the device. + /// The name of the discovered asset. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync pipeline to use to make the request. /// - /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task NamespaceDevicesGetWithResult(string subscriptionId, string resourceGroupName, string namespaceName, string deviceName, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task NamespaceDiscoveredAssetsGetWithResult(string subscriptionId, string resourceGroupName, string namespaceName, string discoveredAssetName, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -11451,8 +11243,8 @@ public partial class DeviceRegistry + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.DeviceRegistry/namespaces/" + global::System.Uri.EscapeDataString(namespaceName) - + "/devices/" - + global::System.Uri.EscapeDataString(deviceName) + + "/discoveredAssets/" + + global::System.Uri.EscapeDataString(discoveredAssetName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -11466,19 +11258,21 @@ public partial class DeviceRegistry await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - return await this.NamespaceDevicesGetWithResult_Call (request, eventListener,sender); + return await this.NamespaceDiscoveredAssetsGetWithResult_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.DeviceRegistry.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 NamespaceDevicesGetWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task NamespaceDiscoveredAssetsGetWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -11497,7 +11291,7 @@ public partial class DeviceRegistry case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.NamespaceDevice.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode.Parse(body.Result)) ); + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.NamespaceDiscoveredAsset.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode.Parse(body.Result)) ); return await _result; } default: @@ -11530,7 +11324,7 @@ public partial class DeviceRegistry } } - /// 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 @@ -11540,7 +11334,7 @@ public partial class DeviceRegistry /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task NamespaceDevicesGet_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.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task NamespaceDiscoveredAssetsGet_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.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -11559,7 +11353,7 @@ public partial class DeviceRegistry case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.NamespaceDevice.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.NamespaceDiscoveredAsset.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: @@ -11581,18 +11375,18 @@ public partial class DeviceRegistry } /// - /// 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 value must be an UUID. /// The name of the resource group. The name is case insensitive. /// The name of the namespace. - /// The name of the device. + /// The name of the discovered asset. /// 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 NamespaceDevicesGet_Validate(string subscriptionId, string resourceGroupName, string namespaceName, string deviceName, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task NamespaceDiscoveredAssetsGet_Validate(string subscriptionId, string resourceGroupName, string namespaceName, string discoveredAssetName, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -11605,14 +11399,14 @@ public partial class DeviceRegistry await eventListener.AssertMinimumLength(nameof(namespaceName),namespaceName,3); await eventListener.AssertMaximumLength(nameof(namespaceName),namespaceName,64); await eventListener.AssertRegEx(nameof(namespaceName), namespaceName, @"^[a-z0-9][a-z0-9-]*[a-z0-9]$"); - await eventListener.AssertNotNull(nameof(deviceName),deviceName); - await eventListener.AssertMinimumLength(nameof(deviceName),deviceName,3); - await eventListener.AssertMaximumLength(nameof(deviceName),deviceName,63); - await eventListener.AssertRegEx(nameof(deviceName), deviceName, @"^[0-9a-zA-Z][a-zA-Z0-9-]*$"); + await eventListener.AssertNotNull(nameof(discoveredAssetName),discoveredAssetName); + await eventListener.AssertMinimumLength(nameof(discoveredAssetName),discoveredAssetName,3); + await eventListener.AssertMaximumLength(nameof(discoveredAssetName),discoveredAssetName,63); + await eventListener.AssertRegEx(nameof(discoveredAssetName), discoveredAssetName, @"^[a-z0-9][a-z0-9-]*[a-z0-9]$"); } } - /// List NamespaceDevice resources by Namespace + /// List NamespaceDiscoveredAsset resources by Namespace /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// The name of the namespace. @@ -11624,9 +11418,9 @@ public partial class DeviceRegistry /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task NamespaceDevicesListByResourceGroup(string subscriptionId, string resourceGroupName, string namespaceName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task NamespaceDiscoveredAssetsListByResourceGroup(string subscriptionId, string resourceGroupName, string namespaceName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -11638,7 +11432,7 @@ public partial class DeviceRegistry + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.DeviceRegistry/namespaces/" + global::System.Uri.EscapeDataString(namespaceName) - + "/devices" + + "/discoveredAssets" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -11652,11 +11446,11 @@ public partial class DeviceRegistry await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.NamespaceDevicesListByResourceGroup_Call (request, onOk,onDefault,eventListener,sender); + await this.NamespaceDiscoveredAssetsListByResourceGroup_Call (request, onOk,onDefault,eventListener,sender); } } - /// List NamespaceDevice resources by Namespace + /// List NamespaceDiscoveredAsset resources by Namespace /// /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled @@ -11666,18 +11460,18 @@ public partial class DeviceRegistry /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task NamespaceDevicesListByResourceGroupViaIdentity(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.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task NamespaceDiscoveredAssetsListByResourceGroupViaIdentity(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.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.DeviceRegistry/namespaces/(?[^/]+)/devices$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.DeviceRegistry/namespaces/(?[^/]+)/discoveredAssets$", 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.DeviceRegistry/namespaces/{namespaceName}/devices'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/discoveredAssets'"); } // replace URI parameters with values from identity @@ -11692,7 +11486,7 @@ public partial class DeviceRegistry + resourceGroupName + "/providers/Microsoft.DeviceRegistry/namespaces/" + namespaceName - + "/devices" + + "/discoveredAssets" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -11706,30 +11500,30 @@ public partial class DeviceRegistry await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.NamespaceDevicesListByResourceGroup_Call (request, onOk,onDefault,eventListener,sender); + await this.NamespaceDiscoveredAssetsListByResourceGroup_Call (request, onOk,onDefault,eventListener,sender); } } - /// List NamespaceDevice resources by Namespace + /// List NamespaceDiscoveredAsset resources by Namespace /// /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync pipeline to use to make the request. /// - /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task NamespaceDevicesListByResourceGroupViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task NamespaceDiscoveredAssetsListByResourceGroupViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.DeviceRegistry/namespaces/(?[^/]+)/devices$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.DeviceRegistry/namespaces/(?[^/]+)/discoveredAssets$", 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.DeviceRegistry/namespaces/{namespaceName}/devices'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/discoveredAssets'"); } // replace URI parameters with values from identity @@ -11744,7 +11538,7 @@ public partial class DeviceRegistry + resourceGroupName + "/providers/Microsoft.DeviceRegistry/namespaces/" + namespaceName - + "/devices" + + "/discoveredAssets" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -11758,23 +11552,23 @@ public partial class DeviceRegistry await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - return await this.NamespaceDevicesListByResourceGroupWithResult_Call (request, eventListener,sender); + return await this.NamespaceDiscoveredAssetsListByResourceGroupWithResult_Call (request, eventListener,sender); } } - /// List NamespaceDevice resources by Namespace + /// List NamespaceDiscoveredAsset resources by Namespace /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// The name of the namespace. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync pipeline to use to make the request. /// - /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task NamespaceDevicesListByResourceGroupWithResult(string subscriptionId, string resourceGroupName, string namespaceName, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task NamespaceDiscoveredAssetsListByResourceGroupWithResult(string subscriptionId, string resourceGroupName, string namespaceName, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -11786,7 +11580,7 @@ public partial class DeviceRegistry + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.DeviceRegistry/namespaces/" + global::System.Uri.EscapeDataString(namespaceName) - + "/devices" + + "/discoveredAssets" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -11800,21 +11594,21 @@ public partial class DeviceRegistry await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - return await this.NamespaceDevicesListByResourceGroupWithResult_Call (request, eventListener,sender); + return await this.NamespaceDiscoveredAssetsListByResourceGroupWithResult_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.DeviceRegistry.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 NamespaceDevicesListByResourceGroupWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task NamespaceDiscoveredAssetsListByResourceGroupWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -11833,7 +11627,7 @@ public partial class DeviceRegistry case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.NamespaceDeviceListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode.Parse(body.Result)) ); + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.NamespaceDiscoveredAssetListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode.Parse(body.Result)) ); return await _result; } default: @@ -11867,7 +11661,7 @@ public partial class DeviceRegistry } /// - /// 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). @@ -11878,7 +11672,7 @@ public partial class DeviceRegistry /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task NamespaceDevicesListByResourceGroup_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.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task NamespaceDiscoveredAssetsListByResourceGroup_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.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -11897,7 +11691,7 @@ public partial class DeviceRegistry case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.NamespaceDeviceListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.NamespaceDiscoveredAssetListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: @@ -11919,8 +11713,8 @@ public partial class DeviceRegistry } /// - /// 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 value must be an UUID. /// The name of the resource group. The name is case insensitive. @@ -11929,7 +11723,7 @@ public partial class DeviceRegistry /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task NamespaceDevicesListByResourceGroup_Validate(string subscriptionId, string resourceGroupName, string namespaceName, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task NamespaceDiscoveredAssetsListByResourceGroup_Validate(string subscriptionId, string resourceGroupName, string namespaceName, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -11945,11 +11739,11 @@ public partial class DeviceRegistry } } - /// update a NamespaceDevice + /// update a NamespaceDiscoveredAsset /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// The name of the namespace. - /// The name of the device. + /// The name of the discovered asset. /// The resource properties to be updated. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled @@ -11960,9 +11754,9 @@ public partial class DeviceRegistry /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task NamespaceDevicesUpdate(string subscriptionId, string resourceGroupName, string namespaceName, string deviceName, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDeviceUpdate body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeUpdate) + public async global::System.Threading.Tasks.Task NamespaceDiscoveredAssetsUpdate(string subscriptionId, string resourceGroupName, string namespaceName, string discoveredAssetName, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDiscoveredAssetUpdate body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -11974,8 +11768,8 @@ public partial class DeviceRegistry + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.DeviceRegistry/namespaces/" + global::System.Uri.EscapeDataString(namespaceName) - + "/devices/" - + global::System.Uri.EscapeDataString(deviceName) + + "/discoveredAssets/" + + global::System.Uri.EscapeDataString(discoveredAssetName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -11993,11 +11787,11 @@ public partial class DeviceRegistry request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.NamespaceDevicesUpdate_Call (request, onOk,onDefault,eventListener,sender); + await this.NamespaceDiscoveredAssetsUpdate_Call (request, onOk,onDefault,eventListener,sender); } } - /// update a NamespaceDevice + /// update a NamespaceDiscoveredAsset /// /// The resource properties to be updated. /// a delegate that is called when the remote service returns 200 (OK). @@ -12009,25 +11803,25 @@ public partial class DeviceRegistry /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task NamespaceDevicesUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDeviceUpdate body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeUpdate) + public async global::System.Threading.Tasks.Task NamespaceDiscoveredAssetsUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDiscoveredAssetUpdate body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.DeviceRegistry/namespaces/(?[^/]+)/devices/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.DeviceRegistry/namespaces/(?[^/]+)/discoveredAssets/(?[^/]+)$", 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.DeviceRegistry/namespaces/{namespaceName}/devices/{deviceName}'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/discoveredAssets/{discoveredAssetName}'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; var namespaceName = _match.Groups["namespaceName"].Value; - var deviceName = _match.Groups["deviceName"].Value; + var discoveredAssetName = _match.Groups["discoveredAssetName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" @@ -12036,8 +11830,8 @@ public partial class DeviceRegistry + resourceGroupName + "/providers/Microsoft.DeviceRegistry/namespaces/" + namespaceName - + "/devices/" - + deviceName + + "/discoveredAssets/" + + discoveredAssetName + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -12055,39 +11849,39 @@ public partial class DeviceRegistry request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.NamespaceDevicesUpdate_Call (request, onOk,onDefault,eventListener,sender); + await this.NamespaceDiscoveredAssetsUpdate_Call (request, onOk,onDefault,eventListener,sender); } } - /// update a NamespaceDevice + /// update a NamespaceDiscoveredAsset /// /// The resource properties to be updated. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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 NamespaceDevicesUpdateViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDeviceUpdate body, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeUpdate) + public async global::System.Threading.Tasks.Task NamespaceDiscoveredAssetsUpdateViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDiscoveredAssetUpdate body, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.DeviceRegistry/namespaces/(?[^/]+)/devices/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.DeviceRegistry/namespaces/(?[^/]+)/discoveredAssets/(?[^/]+)$", 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.DeviceRegistry/namespaces/{namespaceName}/devices/{deviceName}'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/discoveredAssets/{discoveredAssetName}'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; var namespaceName = _match.Groups["namespaceName"].Value; - var deviceName = _match.Groups["deviceName"].Value; + var discoveredAssetName = _match.Groups["discoveredAssetName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" @@ -12096,8 +11890,8 @@ public partial class DeviceRegistry + resourceGroupName + "/providers/Microsoft.DeviceRegistry/namespaces/" + namespaceName - + "/devices/" - + deviceName + + "/discoveredAssets/" + + discoveredAssetName + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -12115,16 +11909,16 @@ public partial class DeviceRegistry request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - return await this.NamespaceDevicesUpdateWithResult_Call (request, eventListener,sender); + return await this.NamespaceDiscoveredAssetsUpdateWithResult_Call (request, eventListener,sender); } } - /// update a NamespaceDevice + /// update a NamespaceDiscoveredAsset /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// The name of the namespace. - /// The name of the device. - /// Json string supplied to the NamespaceDevicesUpdate operation + /// The name of the discovered asset. + /// Json string supplied to the NamespaceDiscoveredAssetsUpdate 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). @@ -12133,9 +11927,9 @@ public partial class DeviceRegistry /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task NamespaceDevicesUpdateViaJsonString(string subscriptionId, string resourceGroupName, string namespaceName, string deviceName, 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.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task NamespaceDiscoveredAssetsUpdateViaJsonString(string subscriptionId, string resourceGroupName, string namespaceName, string discoveredAssetName, 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.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -12147,8 +11941,8 @@ public partial class DeviceRegistry + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.DeviceRegistry/namespaces/" + global::System.Uri.EscapeDataString(namespaceName) - + "/devices/" - + global::System.Uri.EscapeDataString(deviceName) + + "/discoveredAssets/" + + global::System.Uri.EscapeDataString(discoveredAssetName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -12166,25 +11960,25 @@ public partial class DeviceRegistry request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.NamespaceDevicesUpdate_Call (request, onOk,onDefault,eventListener,sender); + await this.NamespaceDiscoveredAssetsUpdate_Call (request, onOk,onDefault,eventListener,sender); } } - /// update a NamespaceDevice + /// update a NamespaceDiscoveredAsset /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// The name of the namespace. - /// The name of the device. - /// Json string supplied to the NamespaceDevicesUpdate operation + /// The name of the discovered asset. + /// Json string supplied to the NamespaceDiscoveredAssetsUpdate operation /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync pipeline to use to make the request. /// - /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task NamespaceDevicesUpdateViaJsonStringWithResult(string subscriptionId, string resourceGroupName, string namespaceName, string deviceName, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task NamespaceDiscoveredAssetsUpdateViaJsonStringWithResult(string subscriptionId, string resourceGroupName, string namespaceName, string discoveredAssetName, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -12196,8 +11990,8 @@ public partial class DeviceRegistry + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.DeviceRegistry/namespaces/" + global::System.Uri.EscapeDataString(namespaceName) - + "/devices/" - + global::System.Uri.EscapeDataString(deviceName) + + "/discoveredAssets/" + + global::System.Uri.EscapeDataString(discoveredAssetName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -12215,26 +12009,26 @@ public partial class DeviceRegistry request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - return await this.NamespaceDevicesUpdateWithResult_Call (request, eventListener,sender); + return await this.NamespaceDiscoveredAssetsUpdateWithResult_Call (request, eventListener,sender); } } - /// update a NamespaceDevice + /// update a NamespaceDiscoveredAsset /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// The name of the namespace. - /// The name of the device. + /// The name of the discovered asset. /// The resource properties to be updated. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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 NamespaceDevicesUpdateWithResult(string subscriptionId, string resourceGroupName, string namespaceName, string deviceName, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDeviceUpdate body, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeUpdate) + public async global::System.Threading.Tasks.Task NamespaceDiscoveredAssetsUpdateWithResult(string subscriptionId, string resourceGroupName, string namespaceName, string discoveredAssetName, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDiscoveredAssetUpdate body, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -12246,8 +12040,8 @@ public partial class DeviceRegistry + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.DeviceRegistry/namespaces/" + global::System.Uri.EscapeDataString(namespaceName) - + "/devices/" - + global::System.Uri.EscapeDataString(deviceName) + + "/discoveredAssets/" + + global::System.Uri.EscapeDataString(discoveredAssetName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -12265,19 +12059,21 @@ public partial class DeviceRegistry request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - return await this.NamespaceDevicesUpdateWithResult_Call (request, eventListener,sender); + return await this.NamespaceDiscoveredAssetsUpdateWithResult_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.DeviceRegistry.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 NamespaceDevicesUpdateWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task NamespaceDiscoveredAssetsUpdateWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -12389,7 +12185,7 @@ public partial class DeviceRegistry case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.NamespaceDevice.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode.Parse(body.Result)) ); + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.NamespaceDiscoveredAsset.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode.Parse(body.Result)) ); return await _result; } default: @@ -12422,7 +12218,7 @@ public partial class DeviceRegistry } } - /// 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 @@ -12432,7 +12228,7 @@ public partial class DeviceRegistry /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task NamespaceDevicesUpdate_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.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task NamespaceDiscoveredAssetsUpdate_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.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -12544,7 +12340,7 @@ public partial class DeviceRegistry case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.NamespaceDevice.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.NamespaceDiscoveredAsset.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: @@ -12566,19 +12362,19 @@ public partial class DeviceRegistry } /// - /// 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 value must be an UUID. /// The name of the resource group. The name is case insensitive. /// The name of the namespace. - /// The name of the device. + /// The name of the discovered asset. /// The resource properties to be updated. /// 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 NamespaceDevicesUpdate_Validate(string subscriptionId, string resourceGroupName, string namespaceName, string deviceName, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDeviceUpdate body, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task NamespaceDiscoveredAssetsUpdate_Validate(string subscriptionId, string resourceGroupName, string namespaceName, string discoveredAssetName, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDiscoveredAssetUpdate body, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -12591,20 +12387,20 @@ public partial class DeviceRegistry await eventListener.AssertMinimumLength(nameof(namespaceName),namespaceName,3); await eventListener.AssertMaximumLength(nameof(namespaceName),namespaceName,64); await eventListener.AssertRegEx(nameof(namespaceName), namespaceName, @"^[a-z0-9][a-z0-9-]*[a-z0-9]$"); - await eventListener.AssertNotNull(nameof(deviceName),deviceName); - await eventListener.AssertMinimumLength(nameof(deviceName),deviceName,3); - await eventListener.AssertMaximumLength(nameof(deviceName),deviceName,63); - await eventListener.AssertRegEx(nameof(deviceName), deviceName, @"^[0-9a-zA-Z][a-zA-Z0-9-]*$"); + await eventListener.AssertNotNull(nameof(discoveredAssetName),discoveredAssetName); + await eventListener.AssertMinimumLength(nameof(discoveredAssetName),discoveredAssetName,3); + await eventListener.AssertMaximumLength(nameof(discoveredAssetName),discoveredAssetName,63); + await eventListener.AssertRegEx(nameof(discoveredAssetName), discoveredAssetName, @"^[a-z0-9][a-z0-9-]*[a-z0-9]$"); await eventListener.AssertNotNull(nameof(body), body); await eventListener.AssertObjectIsValid(nameof(body), body); } } - /// replace a NamespaceDiscoveredAsset + /// replace a NamespaceDiscoveredDevice /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// The name of the namespace. - /// The name of the discovered asset. + /// The name of the discovered device. /// Resource create parameters. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled @@ -12615,9 +12411,9 @@ public partial class DeviceRegistry /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task NamespaceDiscoveredAssetsCreateOrReplace(string subscriptionId, string resourceGroupName, string namespaceName, string discoveredAssetName, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDiscoveredAsset body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeUpdate) + public async global::System.Threading.Tasks.Task NamespaceDiscoveredDevicesCreateOrReplace(string subscriptionId, string resourceGroupName, string namespaceName, string discoveredDeviceName, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDiscoveredDevice body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -12629,8 +12425,8 @@ public partial class DeviceRegistry + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.DeviceRegistry/namespaces/" + global::System.Uri.EscapeDataString(namespaceName) - + "/discoveredAssets/" - + global::System.Uri.EscapeDataString(discoveredAssetName) + + "/discoveredDevices/" + + global::System.Uri.EscapeDataString(discoveredDeviceName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -12648,11 +12444,11 @@ public partial class DeviceRegistry request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.NamespaceDiscoveredAssetsCreateOrReplace_Call (request, onOk,onDefault,eventListener,sender); + await this.NamespaceDiscoveredDevicesCreateOrReplace_Call (request, onOk,onDefault,eventListener,sender); } } - /// replace a NamespaceDiscoveredAsset + /// replace a NamespaceDiscoveredDevice /// /// Resource create parameters. /// a delegate that is called when the remote service returns 200 (OK). @@ -12664,25 +12460,25 @@ public partial class DeviceRegistry /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task NamespaceDiscoveredAssetsCreateOrReplaceViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDiscoveredAsset body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeUpdate) + public async global::System.Threading.Tasks.Task NamespaceDiscoveredDevicesCreateOrReplaceViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDiscoveredDevice body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.DeviceRegistry/namespaces/(?[^/]+)/discoveredAssets/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.DeviceRegistry/namespaces/(?[^/]+)/discoveredDevices/(?[^/]+)$", 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.DeviceRegistry/namespaces/{namespaceName}/discoveredAssets/{discoveredAssetName}'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/discoveredDevices/{discoveredDeviceName}'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; var namespaceName = _match.Groups["namespaceName"].Value; - var discoveredAssetName = _match.Groups["discoveredAssetName"].Value; + var discoveredDeviceName = _match.Groups["discoveredDeviceName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" @@ -12691,8 +12487,8 @@ public partial class DeviceRegistry + resourceGroupName + "/providers/Microsoft.DeviceRegistry/namespaces/" + namespaceName - + "/discoveredAssets/" - + discoveredAssetName + + "/discoveredDevices/" + + discoveredDeviceName + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -12710,39 +12506,39 @@ public partial class DeviceRegistry request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.NamespaceDiscoveredAssetsCreateOrReplace_Call (request, onOk,onDefault,eventListener,sender); + await this.NamespaceDiscoveredDevicesCreateOrReplace_Call (request, onOk,onDefault,eventListener,sender); } } - /// replace a NamespaceDiscoveredAsset + /// replace a NamespaceDiscoveredDevice /// /// Resource create parameters. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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 NamespaceDiscoveredAssetsCreateOrReplaceViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDiscoveredAsset body, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeUpdate) + public async global::System.Threading.Tasks.Task NamespaceDiscoveredDevicesCreateOrReplaceViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDiscoveredDevice body, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.DeviceRegistry/namespaces/(?[^/]+)/discoveredAssets/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.DeviceRegistry/namespaces/(?[^/]+)/discoveredDevices/(?[^/]+)$", 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.DeviceRegistry/namespaces/{namespaceName}/discoveredAssets/{discoveredAssetName}'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/discoveredDevices/{discoveredDeviceName}'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; var namespaceName = _match.Groups["namespaceName"].Value; - var discoveredAssetName = _match.Groups["discoveredAssetName"].Value; + var discoveredDeviceName = _match.Groups["discoveredDeviceName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" @@ -12751,8 +12547,8 @@ public partial class DeviceRegistry + resourceGroupName + "/providers/Microsoft.DeviceRegistry/namespaces/" + namespaceName - + "/discoveredAssets/" - + discoveredAssetName + + "/discoveredDevices/" + + discoveredDeviceName + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -12770,16 +12566,16 @@ public partial class DeviceRegistry request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - return await this.NamespaceDiscoveredAssetsCreateOrReplaceWithResult_Call (request, eventListener,sender); + return await this.NamespaceDiscoveredDevicesCreateOrReplaceWithResult_Call (request, eventListener,sender); } } - /// replace a NamespaceDiscoveredAsset + /// replace a NamespaceDiscoveredDevice /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// The name of the namespace. - /// The name of the discovered asset. - /// Json string supplied to the NamespaceDiscoveredAssetsCreateOrReplace operation + /// The name of the discovered device. + /// Json string supplied to the NamespaceDiscoveredDevicesCreateOrReplace 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). @@ -12788,9 +12584,9 @@ public partial class DeviceRegistry /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task NamespaceDiscoveredAssetsCreateOrReplaceViaJsonString(string subscriptionId, string resourceGroupName, string namespaceName, string discoveredAssetName, 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.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task NamespaceDiscoveredDevicesCreateOrReplaceViaJsonString(string subscriptionId, string resourceGroupName, string namespaceName, string discoveredDeviceName, 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.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -12802,8 +12598,8 @@ public partial class DeviceRegistry + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.DeviceRegistry/namespaces/" + global::System.Uri.EscapeDataString(namespaceName) - + "/discoveredAssets/" - + global::System.Uri.EscapeDataString(discoveredAssetName) + + "/discoveredDevices/" + + global::System.Uri.EscapeDataString(discoveredDeviceName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -12821,25 +12617,25 @@ public partial class DeviceRegistry request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.NamespaceDiscoveredAssetsCreateOrReplace_Call (request, onOk,onDefault,eventListener,sender); + await this.NamespaceDiscoveredDevicesCreateOrReplace_Call (request, onOk,onDefault,eventListener,sender); } } - /// replace a NamespaceDiscoveredAsset + /// replace a NamespaceDiscoveredDevice /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// The name of the namespace. - /// The name of the discovered asset. - /// Json string supplied to the NamespaceDiscoveredAssetsCreateOrReplace operation + /// The name of the discovered device. + /// Json string supplied to the NamespaceDiscoveredDevicesCreateOrReplace operation /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync pipeline to use to make the request. /// - /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task NamespaceDiscoveredAssetsCreateOrReplaceViaJsonStringWithResult(string subscriptionId, string resourceGroupName, string namespaceName, string discoveredAssetName, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task NamespaceDiscoveredDevicesCreateOrReplaceViaJsonStringWithResult(string subscriptionId, string resourceGroupName, string namespaceName, string discoveredDeviceName, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -12851,8 +12647,8 @@ public partial class DeviceRegistry + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.DeviceRegistry/namespaces/" + global::System.Uri.EscapeDataString(namespaceName) - + "/discoveredAssets/" - + global::System.Uri.EscapeDataString(discoveredAssetName) + + "/discoveredDevices/" + + global::System.Uri.EscapeDataString(discoveredDeviceName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -12870,26 +12666,26 @@ public partial class DeviceRegistry request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - return await this.NamespaceDiscoveredAssetsCreateOrReplaceWithResult_Call (request, eventListener,sender); + return await this.NamespaceDiscoveredDevicesCreateOrReplaceWithResult_Call (request, eventListener,sender); } } - /// replace a NamespaceDiscoveredAsset + /// replace a NamespaceDiscoveredDevice /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// The name of the namespace. - /// The name of the discovered asset. + /// The name of the discovered device. /// Resource create parameters. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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 NamespaceDiscoveredAssetsCreateOrReplaceWithResult(string subscriptionId, string resourceGroupName, string namespaceName, string discoveredAssetName, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDiscoveredAsset body, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeUpdate) + public async global::System.Threading.Tasks.Task NamespaceDiscoveredDevicesCreateOrReplaceWithResult(string subscriptionId, string resourceGroupName, string namespaceName, string discoveredDeviceName, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDiscoveredDevice body, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -12901,8 +12697,8 @@ public partial class DeviceRegistry + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.DeviceRegistry/namespaces/" + global::System.Uri.EscapeDataString(namespaceName) - + "/discoveredAssets/" - + global::System.Uri.EscapeDataString(discoveredAssetName) + + "/discoveredDevices/" + + global::System.Uri.EscapeDataString(discoveredDeviceName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -12920,21 +12716,21 @@ public partial class DeviceRegistry request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - return await this.NamespaceDiscoveredAssetsCreateOrReplaceWithResult_Call (request, eventListener,sender); + return await this.NamespaceDiscoveredDevicesCreateOrReplaceWithResult_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.DeviceRegistry.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 NamespaceDiscoveredAssetsCreateOrReplaceWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task NamespaceDiscoveredDevicesCreateOrReplaceWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -13045,7 +12841,7 @@ public partial class DeviceRegistry case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.NamespaceDiscoveredAsset.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode.Parse(body.Result)) ); + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.NamespaceDiscoveredDevice.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode.Parse(body.Result)) ); return await _result; } default: @@ -13079,7 +12875,7 @@ public partial class DeviceRegistry } /// - /// 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). @@ -13090,7 +12886,7 @@ public partial class DeviceRegistry /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task NamespaceDiscoveredAssetsCreateOrReplace_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.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task NamespaceDiscoveredDevicesCreateOrReplace_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.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -13201,7 +12997,7 @@ public partial class DeviceRegistry case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.NamespaceDiscoveredAsset.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.NamespaceDiscoveredDevice.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: @@ -13223,19 +13019,19 @@ public partial class DeviceRegistry } /// - /// Validation method for method. Call this like the actual call, + /// Validation method for method. Call this like the actual call, /// but you will get validation events back. /// /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// The name of the namespace. - /// The name of the discovered asset. + /// The name of the discovered device. /// Resource create parameters. /// 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 NamespaceDiscoveredAssetsCreateOrReplace_Validate(string subscriptionId, string resourceGroupName, string namespaceName, string discoveredAssetName, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDiscoveredAsset body, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task NamespaceDiscoveredDevicesCreateOrReplace_Validate(string subscriptionId, string resourceGroupName, string namespaceName, string discoveredDeviceName, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDiscoveredDevice body, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -13248,20 +13044,20 @@ public partial class DeviceRegistry await eventListener.AssertMinimumLength(nameof(namespaceName),namespaceName,3); await eventListener.AssertMaximumLength(nameof(namespaceName),namespaceName,64); await eventListener.AssertRegEx(nameof(namespaceName), namespaceName, @"^[a-z0-9][a-z0-9-]*[a-z0-9]$"); - await eventListener.AssertNotNull(nameof(discoveredAssetName),discoveredAssetName); - await eventListener.AssertMinimumLength(nameof(discoveredAssetName),discoveredAssetName,3); - await eventListener.AssertMaximumLength(nameof(discoveredAssetName),discoveredAssetName,63); - await eventListener.AssertRegEx(nameof(discoveredAssetName), discoveredAssetName, @"^[a-z0-9][a-z0-9-]*[a-z0-9]$"); + await eventListener.AssertNotNull(nameof(discoveredDeviceName),discoveredDeviceName); + await eventListener.AssertMinimumLength(nameof(discoveredDeviceName),discoveredDeviceName,3); + await eventListener.AssertMaximumLength(nameof(discoveredDeviceName),discoveredDeviceName,63); + await eventListener.AssertRegEx(nameof(discoveredDeviceName), discoveredDeviceName, @"^[a-z0-9][a-z0-9-]*[a-z0-9]$"); await eventListener.AssertNotNull(nameof(body), body); await eventListener.AssertObjectIsValid(nameof(body), body); } } - /// Delete a NamespaceDiscoveredAsset + /// Delete a NamespaceDiscoveredDevice /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// The name of the namespace. - /// The name of the discovered asset. + /// The name of the discovered device. /// 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 @@ -13271,9 +13067,9 @@ public partial class DeviceRegistry /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task NamespaceDiscoveredAssetsDelete(string subscriptionId, string resourceGroupName, string namespaceName, string discoveredAssetName, global::System.Func onNoContent, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task NamespaceDiscoveredDevicesDelete(string subscriptionId, string resourceGroupName, string namespaceName, string discoveredDeviceName, global::System.Func onNoContent, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -13285,8 +13081,8 @@ public partial class DeviceRegistry + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.DeviceRegistry/namespaces/" + global::System.Uri.EscapeDataString(namespaceName) - + "/discoveredAssets/" - + global::System.Uri.EscapeDataString(discoveredAssetName) + + "/discoveredDevices/" + + global::System.Uri.EscapeDataString(discoveredDeviceName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -13300,11 +13096,11 @@ public partial class DeviceRegistry await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.NamespaceDiscoveredAssetsDelete_Call (request, onNoContent,onOk,onDefault,eventListener,sender); + await this.NamespaceDiscoveredDevicesDelete_Call (request, onNoContent,onOk,onDefault,eventListener,sender); } } - /// Delete a NamespaceDiscoveredAsset + /// Delete a NamespaceDiscoveredDevice /// /// a delegate that is called when the remote service returns 204 (NoContent). /// a delegate that is called when the remote service returns 200 (OK). @@ -13315,25 +13111,25 @@ public partial class DeviceRegistry /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task NamespaceDiscoveredAssetsDeleteViaIdentity(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.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task NamespaceDiscoveredDevicesDeleteViaIdentity(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.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.DeviceRegistry/namespaces/(?[^/]+)/discoveredAssets/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.DeviceRegistry/namespaces/(?[^/]+)/discoveredDevices/(?[^/]+)$", 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.DeviceRegistry/namespaces/{namespaceName}/discoveredAssets/{discoveredAssetName}'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/discoveredDevices/{discoveredDeviceName}'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; var namespaceName = _match.Groups["namespaceName"].Value; - var discoveredAssetName = _match.Groups["discoveredAssetName"].Value; + var discoveredDeviceName = _match.Groups["discoveredDeviceName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" @@ -13342,8 +13138,8 @@ public partial class DeviceRegistry + resourceGroupName + "/providers/Microsoft.DeviceRegistry/namespaces/" + namespaceName - + "/discoveredAssets/" - + discoveredAssetName + + "/discoveredDevices/" + + discoveredDeviceName + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -13357,11 +13153,11 @@ public partial class DeviceRegistry await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.NamespaceDiscoveredAssetsDelete_Call (request, onNoContent,onOk,onDefault,eventListener,sender); + await this.NamespaceDiscoveredDevicesDelete_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). @@ -13372,7 +13168,7 @@ public partial class DeviceRegistry /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task NamespaceDiscoveredAssetsDelete_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.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task NamespaceDiscoveredDevicesDelete_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.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -13512,18 +13308,18 @@ public partial class DeviceRegistry } /// - /// 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 value must be an UUID. /// The name of the resource group. The name is case insensitive. /// The name of the namespace. - /// The name of the discovered asset. + /// The name of the discovered device. /// 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 NamespaceDiscoveredAssetsDelete_Validate(string subscriptionId, string resourceGroupName, string namespaceName, string discoveredAssetName, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task NamespaceDiscoveredDevicesDelete_Validate(string subscriptionId, string resourceGroupName, string namespaceName, string discoveredDeviceName, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -13536,18 +13332,18 @@ public partial class DeviceRegistry await eventListener.AssertMinimumLength(nameof(namespaceName),namespaceName,3); await eventListener.AssertMaximumLength(nameof(namespaceName),namespaceName,64); await eventListener.AssertRegEx(nameof(namespaceName), namespaceName, @"^[a-z0-9][a-z0-9-]*[a-z0-9]$"); - await eventListener.AssertNotNull(nameof(discoveredAssetName),discoveredAssetName); - await eventListener.AssertMinimumLength(nameof(discoveredAssetName),discoveredAssetName,3); - await eventListener.AssertMaximumLength(nameof(discoveredAssetName),discoveredAssetName,63); - await eventListener.AssertRegEx(nameof(discoveredAssetName), discoveredAssetName, @"^[a-z0-9][a-z0-9-]*[a-z0-9]$"); + await eventListener.AssertNotNull(nameof(discoveredDeviceName),discoveredDeviceName); + await eventListener.AssertMinimumLength(nameof(discoveredDeviceName),discoveredDeviceName,3); + await eventListener.AssertMaximumLength(nameof(discoveredDeviceName),discoveredDeviceName,63); + await eventListener.AssertRegEx(nameof(discoveredDeviceName), discoveredDeviceName, @"^[a-z0-9][a-z0-9-]*[a-z0-9]$"); } } - /// Get a NamespaceDiscoveredAsset + /// Get a NamespaceDiscoveredDevice /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// The name of the namespace. - /// The name of the discovered asset. + /// The name of the discovered device. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). @@ -13556,9 +13352,9 @@ public partial class DeviceRegistry /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task NamespaceDiscoveredAssetsGet(string subscriptionId, string resourceGroupName, string namespaceName, string discoveredAssetName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task NamespaceDiscoveredDevicesGet(string subscriptionId, string resourceGroupName, string namespaceName, string discoveredDeviceName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -13570,8 +13366,8 @@ public partial class DeviceRegistry + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.DeviceRegistry/namespaces/" + global::System.Uri.EscapeDataString(namespaceName) - + "/discoveredAssets/" - + global::System.Uri.EscapeDataString(discoveredAssetName) + + "/discoveredDevices/" + + global::System.Uri.EscapeDataString(discoveredDeviceName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -13585,11 +13381,11 @@ public partial class DeviceRegistry await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.NamespaceDiscoveredAssetsGet_Call (request, onOk,onDefault,eventListener,sender); + await this.NamespaceDiscoveredDevicesGet_Call (request, onOk,onDefault,eventListener,sender); } } - /// Get a NamespaceDiscoveredAsset + /// Get a NamespaceDiscoveredDevice /// /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled @@ -13599,25 +13395,25 @@ public partial class DeviceRegistry /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task NamespaceDiscoveredAssetsGetViaIdentity(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.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task NamespaceDiscoveredDevicesGetViaIdentity(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.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.DeviceRegistry/namespaces/(?[^/]+)/discoveredAssets/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.DeviceRegistry/namespaces/(?[^/]+)/discoveredDevices/(?[^/]+)$", 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.DeviceRegistry/namespaces/{namespaceName}/discoveredAssets/{discoveredAssetName}'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/discoveredDevices/{discoveredDeviceName}'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; var namespaceName = _match.Groups["namespaceName"].Value; - var discoveredAssetName = _match.Groups["discoveredAssetName"].Value; + var discoveredDeviceName = _match.Groups["discoveredDeviceName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" @@ -13626,8 +13422,8 @@ public partial class DeviceRegistry + resourceGroupName + "/providers/Microsoft.DeviceRegistry/namespaces/" + namespaceName - + "/discoveredAssets/" - + discoveredAssetName + + "/discoveredDevices/" + + discoveredDeviceName + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -13641,37 +13437,37 @@ public partial class DeviceRegistry await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.NamespaceDiscoveredAssetsGet_Call (request, onOk,onDefault,eventListener,sender); + await this.NamespaceDiscoveredDevicesGet_Call (request, onOk,onDefault,eventListener,sender); } } - /// Get a NamespaceDiscoveredAsset + /// Get a NamespaceDiscoveredDevice /// /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync pipeline to use to make the request. /// - /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task NamespaceDiscoveredAssetsGetViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task NamespaceDiscoveredDevicesGetViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.DeviceRegistry/namespaces/(?[^/]+)/discoveredAssets/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.DeviceRegistry/namespaces/(?[^/]+)/discoveredDevices/(?[^/]+)$", 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.DeviceRegistry/namespaces/{namespaceName}/discoveredAssets/{discoveredAssetName}'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/discoveredDevices/{discoveredDeviceName}'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; var namespaceName = _match.Groups["namespaceName"].Value; - var discoveredAssetName = _match.Groups["discoveredAssetName"].Value; + var discoveredDeviceName = _match.Groups["discoveredDeviceName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" @@ -13680,8 +13476,8 @@ public partial class DeviceRegistry + resourceGroupName + "/providers/Microsoft.DeviceRegistry/namespaces/" + namespaceName - + "/discoveredAssets/" - + discoveredAssetName + + "/discoveredDevices/" + + discoveredDeviceName + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -13695,24 +13491,24 @@ public partial class DeviceRegistry await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - return await this.NamespaceDiscoveredAssetsGetWithResult_Call (request, eventListener,sender); + return await this.NamespaceDiscoveredDevicesGetWithResult_Call (request, eventListener,sender); } } - /// Get a NamespaceDiscoveredAsset + /// Get a NamespaceDiscoveredDevice /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// The name of the namespace. - /// The name of the discovered asset. + /// The name of the discovered device. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync pipeline to use to make the request. /// - /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task NamespaceDiscoveredAssetsGetWithResult(string subscriptionId, string resourceGroupName, string namespaceName, string discoveredAssetName, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task NamespaceDiscoveredDevicesGetWithResult(string subscriptionId, string resourceGroupName, string namespaceName, string discoveredDeviceName, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -13724,8 +13520,8 @@ public partial class DeviceRegistry + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.DeviceRegistry/namespaces/" + global::System.Uri.EscapeDataString(namespaceName) - + "/discoveredAssets/" - + global::System.Uri.EscapeDataString(discoveredAssetName) + + "/discoveredDevices/" + + global::System.Uri.EscapeDataString(discoveredDeviceName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -13739,21 +13535,21 @@ public partial class DeviceRegistry await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - return await this.NamespaceDiscoveredAssetsGetWithResult_Call (request, eventListener,sender); + return await this.NamespaceDiscoveredDevicesGetWithResult_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.DeviceRegistry.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 NamespaceDiscoveredAssetsGetWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task NamespaceDiscoveredDevicesGetWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -13772,7 +13568,7 @@ public partial class DeviceRegistry case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.NamespaceDiscoveredAsset.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode.Parse(body.Result)) ); + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.NamespaceDiscoveredDevice.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode.Parse(body.Result)) ); return await _result; } default: @@ -13805,7 +13601,7 @@ public partial class DeviceRegistry } } - /// 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 @@ -13815,7 +13611,7 @@ public partial class DeviceRegistry /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task NamespaceDiscoveredAssetsGet_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.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task NamespaceDiscoveredDevicesGet_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.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -13834,7 +13630,7 @@ public partial class DeviceRegistry case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.NamespaceDiscoveredAsset.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.NamespaceDiscoveredDevice.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: @@ -13856,18 +13652,18 @@ public partial class DeviceRegistry } /// - /// Validation method for method. Call this like the actual call, but you will + /// Validation method for method. Call this like the actual call, but you will /// get validation events back. /// /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// The name of the namespace. - /// The name of the discovered asset. + /// The name of the discovered device. /// 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 NamespaceDiscoveredAssetsGet_Validate(string subscriptionId, string resourceGroupName, string namespaceName, string discoveredAssetName, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task NamespaceDiscoveredDevicesGet_Validate(string subscriptionId, string resourceGroupName, string namespaceName, string discoveredDeviceName, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -13880,14 +13676,14 @@ public partial class DeviceRegistry await eventListener.AssertMinimumLength(nameof(namespaceName),namespaceName,3); await eventListener.AssertMaximumLength(nameof(namespaceName),namespaceName,64); await eventListener.AssertRegEx(nameof(namespaceName), namespaceName, @"^[a-z0-9][a-z0-9-]*[a-z0-9]$"); - await eventListener.AssertNotNull(nameof(discoveredAssetName),discoveredAssetName); - await eventListener.AssertMinimumLength(nameof(discoveredAssetName),discoveredAssetName,3); - await eventListener.AssertMaximumLength(nameof(discoveredAssetName),discoveredAssetName,63); - await eventListener.AssertRegEx(nameof(discoveredAssetName), discoveredAssetName, @"^[a-z0-9][a-z0-9-]*[a-z0-9]$"); + await eventListener.AssertNotNull(nameof(discoveredDeviceName),discoveredDeviceName); + await eventListener.AssertMinimumLength(nameof(discoveredDeviceName),discoveredDeviceName,3); + await eventListener.AssertMaximumLength(nameof(discoveredDeviceName),discoveredDeviceName,63); + await eventListener.AssertRegEx(nameof(discoveredDeviceName), discoveredDeviceName, @"^[a-z0-9][a-z0-9-]*[a-z0-9]$"); } } - /// List NamespaceDiscoveredAsset resources by Namespace + /// List NamespaceDiscoveredDevice resources by Namespace /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// The name of the namespace. @@ -13899,9 +13695,9 @@ public partial class DeviceRegistry /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task NamespaceDiscoveredAssetsListByResourceGroup(string subscriptionId, string resourceGroupName, string namespaceName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task NamespaceDiscoveredDevicesListByResourceGroup(string subscriptionId, string resourceGroupName, string namespaceName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -13913,7 +13709,7 @@ public partial class DeviceRegistry + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.DeviceRegistry/namespaces/" + global::System.Uri.EscapeDataString(namespaceName) - + "/discoveredAssets" + + "/discoveredDevices" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -13927,11 +13723,11 @@ public partial class DeviceRegistry await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.NamespaceDiscoveredAssetsListByResourceGroup_Call (request, onOk,onDefault,eventListener,sender); + await this.NamespaceDiscoveredDevicesListByResourceGroup_Call (request, onOk,onDefault,eventListener,sender); } } - /// List NamespaceDiscoveredAsset resources by Namespace + /// List NamespaceDiscoveredDevice resources by Namespace /// /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled @@ -13941,18 +13737,18 @@ public partial class DeviceRegistry /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task NamespaceDiscoveredAssetsListByResourceGroupViaIdentity(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.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task NamespaceDiscoveredDevicesListByResourceGroupViaIdentity(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.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.DeviceRegistry/namespaces/(?[^/]+)/discoveredAssets$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.DeviceRegistry/namespaces/(?[^/]+)/discoveredDevices$", 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.DeviceRegistry/namespaces/{namespaceName}/discoveredAssets'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/discoveredDevices'"); } // replace URI parameters with values from identity @@ -13967,7 +13763,7 @@ public partial class DeviceRegistry + resourceGroupName + "/providers/Microsoft.DeviceRegistry/namespaces/" + namespaceName - + "/discoveredAssets" + + "/discoveredDevices" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -13981,30 +13777,30 @@ public partial class DeviceRegistry await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.NamespaceDiscoveredAssetsListByResourceGroup_Call (request, onOk,onDefault,eventListener,sender); + await this.NamespaceDiscoveredDevicesListByResourceGroup_Call (request, onOk,onDefault,eventListener,sender); } } - /// List NamespaceDiscoveredAsset resources by Namespace + /// List NamespaceDiscoveredDevice resources by Namespace /// /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync pipeline to use to make the request. /// - /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task NamespaceDiscoveredAssetsListByResourceGroupViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task NamespaceDiscoveredDevicesListByResourceGroupViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.DeviceRegistry/namespaces/(?[^/]+)/discoveredAssets$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.DeviceRegistry/namespaces/(?[^/]+)/discoveredDevices$", 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.DeviceRegistry/namespaces/{namespaceName}/discoveredAssets'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/discoveredDevices'"); } // replace URI parameters with values from identity @@ -14019,7 +13815,7 @@ public partial class DeviceRegistry + resourceGroupName + "/providers/Microsoft.DeviceRegistry/namespaces/" + namespaceName - + "/discoveredAssets" + + "/discoveredDevices" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -14033,23 +13829,23 @@ public partial class DeviceRegistry await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - return await this.NamespaceDiscoveredAssetsListByResourceGroupWithResult_Call (request, eventListener,sender); + return await this.NamespaceDiscoveredDevicesListByResourceGroupWithResult_Call (request, eventListener,sender); } } - /// List NamespaceDiscoveredAsset resources by Namespace + /// List NamespaceDiscoveredDevice resources by Namespace /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// The name of the namespace. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync pipeline to use to make the request. /// - /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task NamespaceDiscoveredAssetsListByResourceGroupWithResult(string subscriptionId, string resourceGroupName, string namespaceName, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task NamespaceDiscoveredDevicesListByResourceGroupWithResult(string subscriptionId, string resourceGroupName, string namespaceName, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -14061,7 +13857,7 @@ public partial class DeviceRegistry + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.DeviceRegistry/namespaces/" + global::System.Uri.EscapeDataString(namespaceName) - + "/discoveredAssets" + + "/discoveredDevices" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -14075,21 +13871,21 @@ public partial class DeviceRegistry await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - return await this.NamespaceDiscoveredAssetsListByResourceGroupWithResult_Call (request, eventListener,sender); + return await this.NamespaceDiscoveredDevicesListByResourceGroupWithResult_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.DeviceRegistry.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 NamespaceDiscoveredAssetsListByResourceGroupWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task NamespaceDiscoveredDevicesListByResourceGroupWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -14108,7 +13904,7 @@ public partial class DeviceRegistry case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.NamespaceDiscoveredAssetListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode.Parse(body.Result)) ); + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.NamespaceDiscoveredDeviceListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode.Parse(body.Result)) ); return await _result; } default: @@ -14142,7 +13938,7 @@ public partial class DeviceRegistry } /// - /// 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). @@ -14153,7 +13949,7 @@ public partial class DeviceRegistry /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task NamespaceDiscoveredAssetsListByResourceGroup_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.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task NamespaceDiscoveredDevicesListByResourceGroup_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.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -14172,7 +13968,7 @@ public partial class DeviceRegistry case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.NamespaceDiscoveredAssetListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.NamespaceDiscoveredDeviceListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: @@ -14194,7 +13990,7 @@ public partial class DeviceRegistry } /// - /// Validation method for method. Call this like the actual call, + /// Validation method for method. Call this like the actual call, /// but you will get validation events back. /// /// The ID of the target subscription. The value must be an UUID. @@ -14204,7 +14000,7 @@ public partial class DeviceRegistry /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task NamespaceDiscoveredAssetsListByResourceGroup_Validate(string subscriptionId, string resourceGroupName, string namespaceName, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task NamespaceDiscoveredDevicesListByResourceGroup_Validate(string subscriptionId, string resourceGroupName, string namespaceName, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -14220,11 +14016,11 @@ public partial class DeviceRegistry } } - /// update a NamespaceDiscoveredAsset + /// update a NamespaceDiscoveredDevice /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// The name of the namespace. - /// The name of the discovered asset. + /// The name of the discovered device. /// The resource properties to be updated. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled @@ -14235,9 +14031,9 @@ public partial class DeviceRegistry /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task NamespaceDiscoveredAssetsUpdate(string subscriptionId, string resourceGroupName, string namespaceName, string discoveredAssetName, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDiscoveredAssetUpdate body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeUpdate) + public async global::System.Threading.Tasks.Task NamespaceDiscoveredDevicesUpdate(string subscriptionId, string resourceGroupName, string namespaceName, string discoveredDeviceName, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDiscoveredDeviceUpdate body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -14249,8 +14045,8 @@ public partial class DeviceRegistry + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.DeviceRegistry/namespaces/" + global::System.Uri.EscapeDataString(namespaceName) - + "/discoveredAssets/" - + global::System.Uri.EscapeDataString(discoveredAssetName) + + "/discoveredDevices/" + + global::System.Uri.EscapeDataString(discoveredDeviceName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -14268,11 +14064,11 @@ public partial class DeviceRegistry request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.NamespaceDiscoveredAssetsUpdate_Call (request, onOk,onDefault,eventListener,sender); + await this.NamespaceDiscoveredDevicesUpdate_Call (request, onOk,onDefault,eventListener,sender); } } - /// update a NamespaceDiscoveredAsset + /// update a NamespaceDiscoveredDevice /// /// The resource properties to be updated. /// a delegate that is called when the remote service returns 200 (OK). @@ -14284,25 +14080,25 @@ public partial class DeviceRegistry /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task NamespaceDiscoveredAssetsUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDiscoveredAssetUpdate body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeUpdate) + public async global::System.Threading.Tasks.Task NamespaceDiscoveredDevicesUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDiscoveredDeviceUpdate body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.DeviceRegistry/namespaces/(?[^/]+)/discoveredAssets/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.DeviceRegistry/namespaces/(?[^/]+)/discoveredDevices/(?[^/]+)$", 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.DeviceRegistry/namespaces/{namespaceName}/discoveredAssets/{discoveredAssetName}'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/discoveredDevices/{discoveredDeviceName}'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; var namespaceName = _match.Groups["namespaceName"].Value; - var discoveredAssetName = _match.Groups["discoveredAssetName"].Value; + var discoveredDeviceName = _match.Groups["discoveredDeviceName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" @@ -14311,8 +14107,8 @@ public partial class DeviceRegistry + resourceGroupName + "/providers/Microsoft.DeviceRegistry/namespaces/" + namespaceName - + "/discoveredAssets/" - + discoveredAssetName + + "/discoveredDevices/" + + discoveredDeviceName + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -14330,39 +14126,39 @@ public partial class DeviceRegistry request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.NamespaceDiscoveredAssetsUpdate_Call (request, onOk,onDefault,eventListener,sender); + await this.NamespaceDiscoveredDevicesUpdate_Call (request, onOk,onDefault,eventListener,sender); } } - /// update a NamespaceDiscoveredAsset + /// update a NamespaceDiscoveredDevice /// /// The resource properties to be updated. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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 NamespaceDiscoveredAssetsUpdateViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDiscoveredAssetUpdate body, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeUpdate) + public async global::System.Threading.Tasks.Task NamespaceDiscoveredDevicesUpdateViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDiscoveredDeviceUpdate body, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.DeviceRegistry/namespaces/(?[^/]+)/discoveredAssets/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.DeviceRegistry/namespaces/(?[^/]+)/discoveredDevices/(?[^/]+)$", 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.DeviceRegistry/namespaces/{namespaceName}/discoveredAssets/{discoveredAssetName}'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/discoveredDevices/{discoveredDeviceName}'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; var namespaceName = _match.Groups["namespaceName"].Value; - var discoveredAssetName = _match.Groups["discoveredAssetName"].Value; + var discoveredDeviceName = _match.Groups["discoveredDeviceName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" @@ -14371,8 +14167,8 @@ public partial class DeviceRegistry + resourceGroupName + "/providers/Microsoft.DeviceRegistry/namespaces/" + namespaceName - + "/discoveredAssets/" - + discoveredAssetName + + "/discoveredDevices/" + + discoveredDeviceName + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -14390,16 +14186,16 @@ public partial class DeviceRegistry request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - return await this.NamespaceDiscoveredAssetsUpdateWithResult_Call (request, eventListener,sender); + return await this.NamespaceDiscoveredDevicesUpdateWithResult_Call (request, eventListener,sender); } } - /// update a NamespaceDiscoveredAsset + /// update a NamespaceDiscoveredDevice /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// The name of the namespace. - /// The name of the discovered asset. - /// Json string supplied to the NamespaceDiscoveredAssetsUpdate operation + /// The name of the discovered device. + /// Json string supplied to the NamespaceDiscoveredDevicesUpdate 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). @@ -14408,9 +14204,9 @@ public partial class DeviceRegistry /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task NamespaceDiscoveredAssetsUpdateViaJsonString(string subscriptionId, string resourceGroupName, string namespaceName, string discoveredAssetName, 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.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task NamespaceDiscoveredDevicesUpdateViaJsonString(string subscriptionId, string resourceGroupName, string namespaceName, string discoveredDeviceName, 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.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -14422,8 +14218,8 @@ public partial class DeviceRegistry + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.DeviceRegistry/namespaces/" + global::System.Uri.EscapeDataString(namespaceName) - + "/discoveredAssets/" - + global::System.Uri.EscapeDataString(discoveredAssetName) + + "/discoveredDevices/" + + global::System.Uri.EscapeDataString(discoveredDeviceName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -14441,25 +14237,25 @@ public partial class DeviceRegistry request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.NamespaceDiscoveredAssetsUpdate_Call (request, onOk,onDefault,eventListener,sender); + await this.NamespaceDiscoveredDevicesUpdate_Call (request, onOk,onDefault,eventListener,sender); } } - /// update a NamespaceDiscoveredAsset + /// update a NamespaceDiscoveredDevice /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// The name of the namespace. - /// The name of the discovered asset. - /// Json string supplied to the NamespaceDiscoveredAssetsUpdate operation + /// The name of the discovered device. + /// Json string supplied to the NamespaceDiscoveredDevicesUpdate operation /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync pipeline to use to make the request. /// - /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task NamespaceDiscoveredAssetsUpdateViaJsonStringWithResult(string subscriptionId, string resourceGroupName, string namespaceName, string discoveredAssetName, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task NamespaceDiscoveredDevicesUpdateViaJsonStringWithResult(string subscriptionId, string resourceGroupName, string namespaceName, string discoveredDeviceName, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -14471,8 +14267,8 @@ public partial class DeviceRegistry + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.DeviceRegistry/namespaces/" + global::System.Uri.EscapeDataString(namespaceName) - + "/discoveredAssets/" - + global::System.Uri.EscapeDataString(discoveredAssetName) + + "/discoveredDevices/" + + global::System.Uri.EscapeDataString(discoveredDeviceName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -14490,26 +14286,26 @@ public partial class DeviceRegistry request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - return await this.NamespaceDiscoveredAssetsUpdateWithResult_Call (request, eventListener,sender); + return await this.NamespaceDiscoveredDevicesUpdateWithResult_Call (request, eventListener,sender); } } - /// update a NamespaceDiscoveredAsset + /// update a NamespaceDiscoveredDevice /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// The name of the namespace. - /// The name of the discovered asset. + /// The name of the discovered device. /// The resource properties to be updated. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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 NamespaceDiscoveredAssetsUpdateWithResult(string subscriptionId, string resourceGroupName, string namespaceName, string discoveredAssetName, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDiscoveredAssetUpdate body, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeUpdate) + public async global::System.Threading.Tasks.Task NamespaceDiscoveredDevicesUpdateWithResult(string subscriptionId, string resourceGroupName, string namespaceName, string discoveredDeviceName, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDiscoveredDeviceUpdate body, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -14521,8 +14317,8 @@ public partial class DeviceRegistry + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.DeviceRegistry/namespaces/" + global::System.Uri.EscapeDataString(namespaceName) - + "/discoveredAssets/" - + global::System.Uri.EscapeDataString(discoveredAssetName) + + "/discoveredDevices/" + + global::System.Uri.EscapeDataString(discoveredDeviceName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -14540,21 +14336,21 @@ public partial class DeviceRegistry request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - return await this.NamespaceDiscoveredAssetsUpdateWithResult_Call (request, eventListener,sender); + return await this.NamespaceDiscoveredDevicesUpdateWithResult_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.DeviceRegistry.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 NamespaceDiscoveredAssetsUpdateWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task NamespaceDiscoveredDevicesUpdateWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -14666,7 +14462,7 @@ public partial class DeviceRegistry case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.NamespaceDiscoveredAsset.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode.Parse(body.Result)) ); + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.NamespaceDiscoveredDevice.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode.Parse(body.Result)) ); return await _result; } default: @@ -14699,7 +14495,7 @@ public partial class DeviceRegistry } } - /// 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 @@ -14709,7 +14505,7 @@ public partial class DeviceRegistry /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task NamespaceDiscoveredAssetsUpdate_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.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task NamespaceDiscoveredDevicesUpdate_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.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -14821,7 +14617,7 @@ public partial class DeviceRegistry case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.NamespaceDiscoveredAsset.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.NamespaceDiscoveredDevice.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: @@ -14843,19 +14639,19 @@ public partial class DeviceRegistry } /// - /// 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 value must be an UUID. /// The name of the resource group. The name is case insensitive. /// The name of the namespace. - /// The name of the discovered asset. + /// The name of the discovered device. /// The resource properties to be updated. /// 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 NamespaceDiscoveredAssetsUpdate_Validate(string subscriptionId, string resourceGroupName, string namespaceName, string discoveredAssetName, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDiscoveredAssetUpdate body, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task NamespaceDiscoveredDevicesUpdate_Validate(string subscriptionId, string resourceGroupName, string namespaceName, string discoveredDeviceName, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDiscoveredDeviceUpdate body, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -14868,20 +14664,19 @@ public partial class DeviceRegistry await eventListener.AssertMinimumLength(nameof(namespaceName),namespaceName,3); await eventListener.AssertMaximumLength(nameof(namespaceName),namespaceName,64); await eventListener.AssertRegEx(nameof(namespaceName), namespaceName, @"^[a-z0-9][a-z0-9-]*[a-z0-9]$"); - await eventListener.AssertNotNull(nameof(discoveredAssetName),discoveredAssetName); - await eventListener.AssertMinimumLength(nameof(discoveredAssetName),discoveredAssetName,3); - await eventListener.AssertMaximumLength(nameof(discoveredAssetName),discoveredAssetName,63); - await eventListener.AssertRegEx(nameof(discoveredAssetName), discoveredAssetName, @"^[a-z0-9][a-z0-9-]*[a-z0-9]$"); + await eventListener.AssertNotNull(nameof(discoveredDeviceName),discoveredDeviceName); + await eventListener.AssertMinimumLength(nameof(discoveredDeviceName),discoveredDeviceName,3); + await eventListener.AssertMaximumLength(nameof(discoveredDeviceName),discoveredDeviceName,63); + await eventListener.AssertRegEx(nameof(discoveredDeviceName), discoveredDeviceName, @"^[a-z0-9][a-z0-9-]*[a-z0-9]$"); await eventListener.AssertNotNull(nameof(body), body); await eventListener.AssertObjectIsValid(nameof(body), body); } } - /// replace a NamespaceDiscoveredDevice + /// replace a Namespace /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// The name of the namespace. - /// The name of the discovered device. /// Resource create parameters. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled @@ -14892,9 +14687,9 @@ public partial class DeviceRegistry /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task NamespaceDiscoveredDevicesCreateOrReplace(string subscriptionId, string resourceGroupName, string namespaceName, string discoveredDeviceName, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDiscoveredDevice body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeUpdate) + public async global::System.Threading.Tasks.Task NamespacesCreateOrReplace(string subscriptionId, string resourceGroupName, string namespaceName, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespace body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -14906,8 +14701,6 @@ public partial class DeviceRegistry + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.DeviceRegistry/namespaces/" + global::System.Uri.EscapeDataString(namespaceName) - + "/discoveredDevices/" - + global::System.Uri.EscapeDataString(discoveredDeviceName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -14925,11 +14718,11 @@ public partial class DeviceRegistry request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.NamespaceDiscoveredDevicesCreateOrReplace_Call (request, onOk,onDefault,eventListener,sender); + await this.NamespacesCreateOrReplace_Call (request, onOk,onDefault,eventListener,sender); } } - /// replace a NamespaceDiscoveredDevice + /// replace a Namespace /// /// Resource create parameters. /// a delegate that is called when the remote service returns 200 (OK). @@ -14941,25 +14734,24 @@ public partial class DeviceRegistry /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task NamespaceDiscoveredDevicesCreateOrReplaceViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDiscoveredDevice body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeUpdate) + public async global::System.Threading.Tasks.Task NamespacesCreateOrReplaceViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespace body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.DeviceRegistry/namespaces/(?[^/]+)/discoveredDevices/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.DeviceRegistry/namespaces/(?[^/]+)$", 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.DeviceRegistry/namespaces/{namespaceName}/discoveredDevices/{discoveredDeviceName}'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; var namespaceName = _match.Groups["namespaceName"].Value; - var discoveredDeviceName = _match.Groups["discoveredDeviceName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" @@ -14968,8 +14760,6 @@ public partial class DeviceRegistry + resourceGroupName + "/providers/Microsoft.DeviceRegistry/namespaces/" + namespaceName - + "/discoveredDevices/" - + discoveredDeviceName + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -14987,39 +14777,38 @@ public partial class DeviceRegistry request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.NamespaceDiscoveredDevicesCreateOrReplace_Call (request, onOk,onDefault,eventListener,sender); + await this.NamespacesCreateOrReplace_Call (request, onOk,onDefault,eventListener,sender); } } - /// replace a NamespaceDiscoveredDevice + /// replace a Namespace /// /// Resource create parameters. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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 NamespaceDiscoveredDevicesCreateOrReplaceViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDiscoveredDevice body, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeUpdate) + public async global::System.Threading.Tasks.Task NamespacesCreateOrReplaceViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespace body, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.DeviceRegistry/namespaces/(?[^/]+)/discoveredDevices/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.DeviceRegistry/namespaces/(?[^/]+)$", 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.DeviceRegistry/namespaces/{namespaceName}/discoveredDevices/{discoveredDeviceName}'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; var namespaceName = _match.Groups["namespaceName"].Value; - var discoveredDeviceName = _match.Groups["discoveredDeviceName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" @@ -15028,8 +14817,6 @@ public partial class DeviceRegistry + resourceGroupName + "/providers/Microsoft.DeviceRegistry/namespaces/" + namespaceName - + "/discoveredDevices/" - + discoveredDeviceName + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -15047,16 +14834,15 @@ public partial class DeviceRegistry request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - return await this.NamespaceDiscoveredDevicesCreateOrReplaceWithResult_Call (request, eventListener,sender); + return await this.NamespacesCreateOrReplaceWithResult_Call (request, eventListener,sender); } } - /// replace a NamespaceDiscoveredDevice + /// replace a Namespace /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// The name of the namespace. - /// The name of the discovered device. - /// Json string supplied to the NamespaceDiscoveredDevicesCreateOrReplace operation + /// Json string supplied to the NamespacesCreateOrReplace 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). @@ -15065,9 +14851,9 @@ public partial class DeviceRegistry /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task NamespaceDiscoveredDevicesCreateOrReplaceViaJsonString(string subscriptionId, string resourceGroupName, string namespaceName, string discoveredDeviceName, 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.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task NamespacesCreateOrReplaceViaJsonString(string subscriptionId, string resourceGroupName, string namespaceName, 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.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -15079,8 +14865,6 @@ public partial class DeviceRegistry + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.DeviceRegistry/namespaces/" + global::System.Uri.EscapeDataString(namespaceName) - + "/discoveredDevices/" - + global::System.Uri.EscapeDataString(discoveredDeviceName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -15098,25 +14882,24 @@ public partial class DeviceRegistry request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.NamespaceDiscoveredDevicesCreateOrReplace_Call (request, onOk,onDefault,eventListener,sender); + await this.NamespacesCreateOrReplace_Call (request, onOk,onDefault,eventListener,sender); } } - /// replace a NamespaceDiscoveredDevice + /// replace a Namespace /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// The name of the namespace. - /// The name of the discovered device. - /// Json string supplied to the NamespaceDiscoveredDevicesCreateOrReplace operation + /// Json string supplied to the NamespacesCreateOrReplace operation /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync pipeline to use to make the request. /// - /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task NamespaceDiscoveredDevicesCreateOrReplaceViaJsonStringWithResult(string subscriptionId, string resourceGroupName, string namespaceName, string discoveredDeviceName, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task NamespacesCreateOrReplaceViaJsonStringWithResult(string subscriptionId, string resourceGroupName, string namespaceName, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -15128,8 +14911,6 @@ public partial class DeviceRegistry + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.DeviceRegistry/namespaces/" + global::System.Uri.EscapeDataString(namespaceName) - + "/discoveredDevices/" - + global::System.Uri.EscapeDataString(discoveredDeviceName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -15147,26 +14928,25 @@ public partial class DeviceRegistry request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - return await this.NamespaceDiscoveredDevicesCreateOrReplaceWithResult_Call (request, eventListener,sender); + return await this.NamespacesCreateOrReplaceWithResult_Call (request, eventListener,sender); } } - /// replace a NamespaceDiscoveredDevice + /// replace a Namespace /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// The name of the namespace. - /// The name of the discovered device. /// Resource create parameters. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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 NamespaceDiscoveredDevicesCreateOrReplaceWithResult(string subscriptionId, string resourceGroupName, string namespaceName, string discoveredDeviceName, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDiscoveredDevice body, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeUpdate) + public async global::System.Threading.Tasks.Task NamespacesCreateOrReplaceWithResult(string subscriptionId, string resourceGroupName, string namespaceName, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespace body, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -15178,8 +14958,6 @@ public partial class DeviceRegistry + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.DeviceRegistry/namespaces/" + global::System.Uri.EscapeDataString(namespaceName) - + "/discoveredDevices/" - + global::System.Uri.EscapeDataString(discoveredDeviceName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -15197,21 +14975,21 @@ public partial class DeviceRegistry request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - return await this.NamespaceDiscoveredDevicesCreateOrReplaceWithResult_Call (request, eventListener,sender); + return await this.NamespacesCreateOrReplaceWithResult_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.DeviceRegistry.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 NamespaceDiscoveredDevicesCreateOrReplaceWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task NamespacesCreateOrReplaceWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -15322,7 +15100,7 @@ public partial class DeviceRegistry case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.NamespaceDiscoveredDevice.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode.Parse(body.Result)) ); + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.Namespace.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode.Parse(body.Result)) ); return await _result; } default: @@ -15355,9 +15133,7 @@ public partial class DeviceRegistry } } - /// - /// 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 @@ -15367,7 +15143,7 @@ public partial class DeviceRegistry /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task NamespaceDiscoveredDevicesCreateOrReplace_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.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task NamespacesCreateOrReplace_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.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -15478,7 +15254,7 @@ public partial class DeviceRegistry case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.NamespaceDiscoveredDevice.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.Namespace.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: @@ -15500,19 +15276,18 @@ public partial class DeviceRegistry } /// - /// 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 value must be an UUID. /// The name of the resource group. The name is case insensitive. /// The name of the namespace. - /// The name of the discovered device. /// Resource create parameters. /// 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 NamespaceDiscoveredDevicesCreateOrReplace_Validate(string subscriptionId, string resourceGroupName, string namespaceName, string discoveredDeviceName, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDiscoveredDevice body, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task NamespacesCreateOrReplace_Validate(string subscriptionId, string resourceGroupName, string namespaceName, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespace body, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -15525,20 +15300,15 @@ public partial class DeviceRegistry await eventListener.AssertMinimumLength(nameof(namespaceName),namespaceName,3); await eventListener.AssertMaximumLength(nameof(namespaceName),namespaceName,64); await eventListener.AssertRegEx(nameof(namespaceName), namespaceName, @"^[a-z0-9][a-z0-9-]*[a-z0-9]$"); - await eventListener.AssertNotNull(nameof(discoveredDeviceName),discoveredDeviceName); - await eventListener.AssertMinimumLength(nameof(discoveredDeviceName),discoveredDeviceName,3); - await eventListener.AssertMaximumLength(nameof(discoveredDeviceName),discoveredDeviceName,63); - await eventListener.AssertRegEx(nameof(discoveredDeviceName), discoveredDeviceName, @"^[a-z0-9][a-z0-9-]*[a-z0-9]$"); await eventListener.AssertNotNull(nameof(body), body); await eventListener.AssertObjectIsValid(nameof(body), body); } } - /// Delete a NamespaceDiscoveredDevice + /// Delete a Namespace /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// The name of the namespace. - /// The name of the discovered device. /// 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 @@ -15548,9 +15318,9 @@ public partial class DeviceRegistry /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task NamespaceDiscoveredDevicesDelete(string subscriptionId, string resourceGroupName, string namespaceName, string discoveredDeviceName, global::System.Func onNoContent, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task NamespacesDelete(string subscriptionId, string resourceGroupName, string namespaceName, global::System.Func onNoContent, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -15562,8 +15332,6 @@ public partial class DeviceRegistry + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.DeviceRegistry/namespaces/" + global::System.Uri.EscapeDataString(namespaceName) - + "/discoveredDevices/" - + global::System.Uri.EscapeDataString(discoveredDeviceName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -15577,11 +15345,11 @@ public partial class DeviceRegistry await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.NamespaceDiscoveredDevicesDelete_Call (request, onNoContent,onOk,onDefault,eventListener,sender); + await this.NamespacesDelete_Call (request, onNoContent,onOk,onDefault,eventListener,sender); } } - /// Delete a NamespaceDiscoveredDevice + /// Delete a Namespace /// /// a delegate that is called when the remote service returns 204 (NoContent). /// a delegate that is called when the remote service returns 200 (OK). @@ -15592,25 +15360,24 @@ public partial class DeviceRegistry /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task NamespaceDiscoveredDevicesDeleteViaIdentity(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.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task NamespacesDeleteViaIdentity(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.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.DeviceRegistry/namespaces/(?[^/]+)/discoveredDevices/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.DeviceRegistry/namespaces/(?[^/]+)$", 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.DeviceRegistry/namespaces/{namespaceName}/discoveredDevices/{discoveredDeviceName}'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; var namespaceName = _match.Groups["namespaceName"].Value; - var discoveredDeviceName = _match.Groups["discoveredDeviceName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" @@ -15619,8 +15386,6 @@ public partial class DeviceRegistry + resourceGroupName + "/providers/Microsoft.DeviceRegistry/namespaces/" + namespaceName - + "/discoveredDevices/" - + discoveredDeviceName + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -15634,11 +15399,11 @@ public partial class DeviceRegistry await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.NamespaceDiscoveredDevicesDelete_Call (request, onNoContent,onOk,onDefault,eventListener,sender); + await this.NamespacesDelete_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). @@ -15649,7 +15414,7 @@ public partial class DeviceRegistry /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task NamespaceDiscoveredDevicesDelete_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.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task NamespacesDelete_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.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -15789,18 +15554,17 @@ public partial class DeviceRegistry } /// - /// 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 value must be an UUID. /// The name of the resource group. The name is case insensitive. /// The name of the namespace. - /// The name of the discovered device. /// 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 NamespaceDiscoveredDevicesDelete_Validate(string subscriptionId, string resourceGroupName, string namespaceName, string discoveredDeviceName, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task NamespacesDelete_Validate(string subscriptionId, string resourceGroupName, string namespaceName, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -15813,18 +15577,13 @@ public partial class DeviceRegistry await eventListener.AssertMinimumLength(nameof(namespaceName),namespaceName,3); await eventListener.AssertMaximumLength(nameof(namespaceName),namespaceName,64); await eventListener.AssertRegEx(nameof(namespaceName), namespaceName, @"^[a-z0-9][a-z0-9-]*[a-z0-9]$"); - await eventListener.AssertNotNull(nameof(discoveredDeviceName),discoveredDeviceName); - await eventListener.AssertMinimumLength(nameof(discoveredDeviceName),discoveredDeviceName,3); - await eventListener.AssertMaximumLength(nameof(discoveredDeviceName),discoveredDeviceName,63); - await eventListener.AssertRegEx(nameof(discoveredDeviceName), discoveredDeviceName, @"^[a-z0-9][a-z0-9-]*[a-z0-9]$"); } } - /// Get a NamespaceDiscoveredDevice + /// Get a Namespace /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// The name of the namespace. - /// The name of the discovered device. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). @@ -15833,9 +15592,9 @@ public partial class DeviceRegistry /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task NamespaceDiscoveredDevicesGet(string subscriptionId, string resourceGroupName, string namespaceName, string discoveredDeviceName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task NamespacesGet(string subscriptionId, string resourceGroupName, string namespaceName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -15847,8 +15606,6 @@ public partial class DeviceRegistry + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.DeviceRegistry/namespaces/" + global::System.Uri.EscapeDataString(namespaceName) - + "/discoveredDevices/" - + global::System.Uri.EscapeDataString(discoveredDeviceName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -15862,11 +15619,11 @@ public partial class DeviceRegistry await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.NamespaceDiscoveredDevicesGet_Call (request, onOk,onDefault,eventListener,sender); + await this.NamespacesGet_Call (request, onOk,onDefault,eventListener,sender); } } - /// Get a NamespaceDiscoveredDevice + /// Get a Namespace /// /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled @@ -15876,25 +15633,24 @@ public partial class DeviceRegistry /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task NamespaceDiscoveredDevicesGetViaIdentity(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.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task NamespacesGetViaIdentity(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.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.DeviceRegistry/namespaces/(?[^/]+)/discoveredDevices/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.DeviceRegistry/namespaces/(?[^/]+)$", 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.DeviceRegistry/namespaces/{namespaceName}/discoveredDevices/{discoveredDeviceName}'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; var namespaceName = _match.Groups["namespaceName"].Value; - var discoveredDeviceName = _match.Groups["discoveredDeviceName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" @@ -15903,8 +15659,6 @@ public partial class DeviceRegistry + resourceGroupName + "/providers/Microsoft.DeviceRegistry/namespaces/" + namespaceName - + "/discoveredDevices/" - + discoveredDeviceName + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -15918,37 +15672,36 @@ public partial class DeviceRegistry await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.NamespaceDiscoveredDevicesGet_Call (request, onOk,onDefault,eventListener,sender); + await this.NamespacesGet_Call (request, onOk,onDefault,eventListener,sender); } } - /// Get a NamespaceDiscoveredDevice + /// Get a Namespace /// /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync pipeline to use to make the request. /// - /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task NamespaceDiscoveredDevicesGetViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task NamespacesGetViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.DeviceRegistry/namespaces/(?[^/]+)/discoveredDevices/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.DeviceRegistry/namespaces/(?[^/]+)$", 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.DeviceRegistry/namespaces/{namespaceName}/discoveredDevices/{discoveredDeviceName}'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; var namespaceName = _match.Groups["namespaceName"].Value; - var discoveredDeviceName = _match.Groups["discoveredDeviceName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" @@ -15957,8 +15710,6 @@ public partial class DeviceRegistry + resourceGroupName + "/providers/Microsoft.DeviceRegistry/namespaces/" + namespaceName - + "/discoveredDevices/" - + discoveredDeviceName + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -15972,24 +15723,23 @@ public partial class DeviceRegistry await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - return await this.NamespaceDiscoveredDevicesGetWithResult_Call (request, eventListener,sender); + return await this.NamespacesGetWithResult_Call (request, eventListener,sender); } } - /// Get a NamespaceDiscoveredDevice + /// Get a Namespace /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// The name of the namespace. - /// The name of the discovered device. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync pipeline to use to make the request. /// - /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task NamespaceDiscoveredDevicesGetWithResult(string subscriptionId, string resourceGroupName, string namespaceName, string discoveredDeviceName, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task NamespacesGetWithResult(string subscriptionId, string resourceGroupName, string namespaceName, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -16001,8 +15751,6 @@ public partial class DeviceRegistry + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.DeviceRegistry/namespaces/" + global::System.Uri.EscapeDataString(namespaceName) - + "/discoveredDevices/" - + global::System.Uri.EscapeDataString(discoveredDeviceName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -16016,21 +15764,19 @@ public partial class DeviceRegistry await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - return await this.NamespaceDiscoveredDevicesGetWithResult_Call (request, eventListener,sender); + return await this.NamespacesGetWithResult_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.DeviceRegistry.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 NamespaceDiscoveredDevicesGetWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task NamespacesGetWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -16049,7 +15795,7 @@ public partial class DeviceRegistry case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.NamespaceDiscoveredDevice.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode.Parse(body.Result)) ); + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.Namespace.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode.Parse(body.Result)) ); return await _result; } default: @@ -16082,7 +15828,7 @@ public partial class DeviceRegistry } } - /// 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 @@ -16092,7 +15838,7 @@ public partial class DeviceRegistry /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task NamespaceDiscoveredDevicesGet_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.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task NamespacesGet_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.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -16111,7 +15857,7 @@ public partial class DeviceRegistry case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.NamespaceDiscoveredDevice.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.Namespace.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: @@ -16133,18 +15879,17 @@ public partial class DeviceRegistry } /// - /// 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 value must be an UUID. /// The name of the resource group. The name is case insensitive. /// The name of the namespace. - /// The name of the discovered device. /// 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 NamespaceDiscoveredDevicesGet_Validate(string subscriptionId, string resourceGroupName, string namespaceName, string discoveredDeviceName, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task NamespacesGet_Validate(string subscriptionId, string resourceGroupName, string namespaceName, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -16157,17 +15902,12 @@ public partial class DeviceRegistry await eventListener.AssertMinimumLength(nameof(namespaceName),namespaceName,3); await eventListener.AssertMaximumLength(nameof(namespaceName),namespaceName,64); await eventListener.AssertRegEx(nameof(namespaceName), namespaceName, @"^[a-z0-9][a-z0-9-]*[a-z0-9]$"); - await eventListener.AssertNotNull(nameof(discoveredDeviceName),discoveredDeviceName); - await eventListener.AssertMinimumLength(nameof(discoveredDeviceName),discoveredDeviceName,3); - await eventListener.AssertMaximumLength(nameof(discoveredDeviceName),discoveredDeviceName,63); - await eventListener.AssertRegEx(nameof(discoveredDeviceName), discoveredDeviceName, @"^[a-z0-9][a-z0-9-]*[a-z0-9]$"); } } - /// List NamespaceDiscoveredDevice resources by Namespace + /// List Namespace resources by resource group /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. - /// The name of the namespace. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). @@ -16176,9 +15916,9 @@ public partial class DeviceRegistry /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task NamespaceDiscoveredDevicesListByResourceGroup(string subscriptionId, string resourceGroupName, string namespaceName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task NamespacesListByResourceGroup(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.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -16188,9 +15928,7 @@ public partial class DeviceRegistry + global::System.Uri.EscapeDataString(subscriptionId) + "/resourceGroups/" + global::System.Uri.EscapeDataString(resourceGroupName) - + "/providers/Microsoft.DeviceRegistry/namespaces/" - + global::System.Uri.EscapeDataString(namespaceName) - + "/discoveredDevices" + + "/providers/Microsoft.DeviceRegistry/namespaces" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -16204,11 +15942,11 @@ public partial class DeviceRegistry await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.NamespaceDiscoveredDevicesListByResourceGroup_Call (request, onOk,onDefault,eventListener,sender); + await this.NamespacesListByResourceGroup_Call (request, onOk,onDefault,eventListener,sender); } } - /// List NamespaceDiscoveredDevice resources by Namespace + /// List Namespace resources by 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 @@ -16218,33 +15956,30 @@ public partial class DeviceRegistry /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task NamespaceDiscoveredDevicesListByResourceGroupViaIdentity(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.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task NamespacesListByResourceGroupViaIdentity(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.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.DeviceRegistry/namespaces/(?[^/]+)/discoveredDevices$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.DeviceRegistry/namespaces$", 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.DeviceRegistry/namespaces/{namespaceName}/discoveredDevices'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var namespaceName = _match.Groups["namespaceName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + subscriptionId + "/resourceGroups/" + resourceGroupName - + "/providers/Microsoft.DeviceRegistry/namespaces/" - + namespaceName - + "/discoveredDevices" + + "/providers/Microsoft.DeviceRegistry/namespaces" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -16258,45 +15993,42 @@ public partial class DeviceRegistry await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.NamespaceDiscoveredDevicesListByResourceGroup_Call (request, onOk,onDefault,eventListener,sender); + await this.NamespacesListByResourceGroup_Call (request, onOk,onDefault,eventListener,sender); } } - /// List NamespaceDiscoveredDevice resources by Namespace + /// List Namespace resources by resource group /// /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync pipeline to use to make the request. /// - /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task NamespaceDiscoveredDevicesListByResourceGroupViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task NamespacesListByResourceGroupViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.DeviceRegistry/namespaces/(?[^/]+)/discoveredDevices$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.DeviceRegistry/namespaces$", 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.DeviceRegistry/namespaces/{namespaceName}/discoveredDevices'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var namespaceName = _match.Groups["namespaceName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + subscriptionId + "/resourceGroups/" + resourceGroupName - + "/providers/Microsoft.DeviceRegistry/namespaces/" - + namespaceName - + "/discoveredDevices" + + "/providers/Microsoft.DeviceRegistry/namespaces" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -16310,23 +16042,22 @@ public partial class DeviceRegistry await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - return await this.NamespaceDiscoveredDevicesListByResourceGroupWithResult_Call (request, eventListener,sender); + return await this.NamespacesListByResourceGroupWithResult_Call (request, eventListener,sender); } } - /// List NamespaceDiscoveredDevice resources by Namespace + /// List Namespace resources by resource group /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. - /// The name of the namespace. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync pipeline to use to make the request. /// - /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task NamespaceDiscoveredDevicesListByResourceGroupWithResult(string subscriptionId, string resourceGroupName, string namespaceName, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task NamespacesListByResourceGroupWithResult(string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -16336,9 +16067,7 @@ public partial class DeviceRegistry + global::System.Uri.EscapeDataString(subscriptionId) + "/resourceGroups/" + global::System.Uri.EscapeDataString(resourceGroupName) - + "/providers/Microsoft.DeviceRegistry/namespaces/" - + global::System.Uri.EscapeDataString(namespaceName) - + "/discoveredDevices" + + "/providers/Microsoft.DeviceRegistry/namespaces" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -16352,21 +16081,21 @@ public partial class DeviceRegistry await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - return await this.NamespaceDiscoveredDevicesListByResourceGroupWithResult_Call (request, eventListener,sender); + return await this.NamespacesListByResourceGroupWithResult_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.DeviceRegistry.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 NamespaceDiscoveredDevicesListByResourceGroupWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task NamespacesListByResourceGroupWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -16385,7 +16114,7 @@ public partial class DeviceRegistry case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.NamespaceDiscoveredDeviceListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode.Parse(body.Result)) ); + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.NamespaceListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode.Parse(body.Result)) ); return await _result; } default: @@ -16418,9 +16147,7 @@ public partial class DeviceRegistry } } - /// - /// 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 @@ -16430,7 +16157,7 @@ public partial class DeviceRegistry /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task NamespaceDiscoveredDevicesListByResourceGroup_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.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task NamespacesListByResourceGroup_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.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -16449,7 +16176,7 @@ public partial class DeviceRegistry case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.NamespaceDiscoveredDeviceListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.NamespaceListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: @@ -16471,17 +16198,16 @@ public partial class DeviceRegistry } /// - /// 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 value must be an UUID. /// The name of the resource group. The name is case insensitive. - /// The name of the namespace. /// 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 NamespaceDiscoveredDevicesListByResourceGroup_Validate(string subscriptionId, string resourceGroupName, string namespaceName, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task NamespacesListByResourceGroup_Validate(string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -16490,31 +16216,22 @@ public partial class DeviceRegistry await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertNotNull(nameof(namespaceName),namespaceName); - await eventListener.AssertMinimumLength(nameof(namespaceName),namespaceName,3); - await eventListener.AssertMaximumLength(nameof(namespaceName),namespaceName,64); - await eventListener.AssertRegEx(nameof(namespaceName), namespaceName, @"^[a-z0-9][a-z0-9-]*[a-z0-9]$"); } } - /// update a NamespaceDiscoveredDevice + /// List Namespace resources by subscription ID /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of the namespace. - /// The name of the discovered device. - /// The resource properties to be updated. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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 NamespaceDiscoveredDevicesUpdate(string subscriptionId, string resourceGroupName, string namespaceName, string discoveredDeviceName, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDiscoveredDeviceUpdate body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeUpdate) + public async global::System.Threading.Tasks.Task NamespacesListBySubscription(string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -16522,12 +16239,7 @@ public partial class DeviceRegistry var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + global::System.Uri.EscapeDataString(subscriptionId) - + "/resourceGroups/" - + global::System.Uri.EscapeDataString(resourceGroupName) - + "/providers/Microsoft.DeviceRegistry/namespaces/" - + global::System.Uri.EscapeDataString(namespaceName) - + "/discoveredDevices/" - + global::System.Uri.EscapeDataString(discoveredDeviceName) + + "/providers/Microsoft.DeviceRegistry/namespaces" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -16536,60 +16248,46 @@ public partial class DeviceRegistry // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Method.Patch, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Method.Get, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.NamespaceDiscoveredDevicesUpdate_Call (request, onOk,onDefault,eventListener,sender); + await this.NamespacesListBySubscription_Call (request, onOk,onDefault,eventListener,sender); } } - /// update a NamespaceDiscoveredDevice + /// List Namespace resources by subscription ID /// - /// The resource properties to be updated. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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 NamespaceDiscoveredDevicesUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDiscoveredDeviceUpdate body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeUpdate) + public async global::System.Threading.Tasks.Task NamespacesListBySubscriptionViaIdentity(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.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.DeviceRegistry/namespaces/(?[^/]+)/discoveredDevices/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/providers/Microsoft.DeviceRegistry/namespaces$", 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.DeviceRegistry/namespaces/{namespaceName}/discoveredDevices/{discoveredDeviceName}'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.DeviceRegistry/namespaces'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var namespaceName = _match.Groups["namespaceName"].Value; - var discoveredDeviceName = _match.Groups["discoveredDeviceName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + subscriptionId - + "/resourceGroups/" - + resourceGroupName - + "/providers/Microsoft.DeviceRegistry/namespaces/" - + namespaceName - + "/discoveredDevices/" - + discoveredDeviceName + + "/providers/Microsoft.DeviceRegistry/namespaces" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -16598,58 +16296,44 @@ public partial class DeviceRegistry // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Method.Patch, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Method.Get, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.NamespaceDiscoveredDevicesUpdate_Call (request, onOk,onDefault,eventListener,sender); + await this.NamespacesListBySubscription_Call (request, onOk,onDefault,eventListener,sender); } } - /// update a NamespaceDiscoveredDevice + /// List Namespace resources by subscription ID /// - /// The resource properties to be updated. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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 NamespaceDiscoveredDevicesUpdateViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDiscoveredDeviceUpdate body, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeUpdate) + public async global::System.Threading.Tasks.Task NamespacesListBySubscriptionViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.DeviceRegistry/namespaces/(?[^/]+)/discoveredDevices/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/providers/Microsoft.DeviceRegistry/namespaces$", 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.DeviceRegistry/namespaces/{namespaceName}/discoveredDevices/{discoveredDeviceName}'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.DeviceRegistry/namespaces'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var namespaceName = _match.Groups["namespaceName"].Value; - var discoveredDeviceName = _match.Groups["discoveredDeviceName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + subscriptionId - + "/resourceGroups/" - + resourceGroupName - + "/providers/Microsoft.DeviceRegistry/namespaces/" - + namespaceName - + "/discoveredDevices/" - + discoveredDeviceName + + "/providers/Microsoft.DeviceRegistry/namespaces" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -16658,85 +16342,26 @@ public partial class DeviceRegistry // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Method.Patch, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Method.Get, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } - // make the call - return await this.NamespaceDiscoveredDevicesUpdateWithResult_Call (request, eventListener,sender); - } - } - - /// update a NamespaceDiscoveredDevice - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of the namespace. - /// The name of the discovered device. - /// Json string supplied to the NamespaceDiscoveredDevicesUpdate 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.DeviceRegistry.Runtime.ISendAsync pipeline to use to make the request. - /// - /// A that will be complete when handling of the response is completed. - /// - public async global::System.Threading.Tasks.Task NamespaceDiscoveredDevicesUpdateViaJsonString(string subscriptionId, string resourceGroupName, string namespaceName, string discoveredDeviceName, 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.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) - { - var apiVersion = @"2025-11-01-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.DeviceRegistry/namespaces/" - + global::System.Uri.EscapeDataString(namespaceName) - + "/discoveredDevices/" - + global::System.Uri.EscapeDataString(discoveredDeviceName) - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.Method.Patch, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.NamespaceDiscoveredDevicesUpdate_Call (request, onOk,onDefault,eventListener,sender); + return await this.NamespacesListBySubscriptionWithResult_Call (request, eventListener,sender); } } - /// update a NamespaceDiscoveredDevice + /// List Namespace resources by subscription ID /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of the namespace. - /// The name of the discovered device. - /// Json string supplied to the NamespaceDiscoveredDevicesUpdate operation /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync pipeline to use to make the request. /// - /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task NamespaceDiscoveredDevicesUpdateViaJsonStringWithResult(string subscriptionId, string resourceGroupName, string namespaceName, string discoveredDeviceName, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task NamespacesListBySubscriptionWithResult(string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -16744,12 +16369,7 @@ public partial class DeviceRegistry var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + global::System.Uri.EscapeDataString(subscriptionId) - + "/resourceGroups/" - + global::System.Uri.EscapeDataString(resourceGroupName) - + "/providers/Microsoft.DeviceRegistry/namespaces/" - + global::System.Uri.EscapeDataString(namespaceName) - + "/discoveredDevices/" - + global::System.Uri.EscapeDataString(discoveredDeviceName) + + "/providers/Microsoft.DeviceRegistry/namespaces" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -16758,4003 +16378,26 @@ public partial class DeviceRegistry // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Method.Patch, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Method.Get, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - return await this.NamespaceDiscoveredDevicesUpdateWithResult_Call (request, eventListener,sender); + return await this.NamespacesListBySubscriptionWithResult_Call (request, eventListener,sender); } } - /// update a NamespaceDiscoveredDevice - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of the namespace. - /// The name of the discovered device. - /// The resource properties to be updated. + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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 NamespaceDiscoveredDevicesUpdateWithResult(string subscriptionId, string resourceGroupName, string namespaceName, string discoveredDeviceName, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDiscoveredDeviceUpdate body, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeUpdate) - { - var apiVersion = @"2025-11-01-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.DeviceRegistry/namespaces/" - + global::System.Uri.EscapeDataString(namespaceName) - + "/discoveredDevices/" - + global::System.Uri.EscapeDataString(discoveredDeviceName) - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.Method.Patch, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } - // make the call - return await this.NamespaceDiscoveredDevicesUpdateWithResult_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.DeviceRegistry.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 NamespaceDiscoveredDevicesUpdateWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) - { - using( NoSynchronizationContext ) - { - global::System.Net.Http.HttpResponseMessage _response = null; - try - { - // this operation supports x-ms-long-running-operation - var _originalUri = request.RequestUri.AbsoluteUri; - var sendTask = sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return null; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - // declared final-state-via: location - var _finalUri = _response.GetFirstHeader(@"Location"); - var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - var location = _response.GetFirstHeader(@"Location"); - var operationLocation = _response.GetFirstHeader(@"Operation-Location"); - while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) - { - // delay before making the next polling request - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - break; - } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.NamespaceDiscoveredDevice.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode.Parse(body.Result)) ); - return await _result; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.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 NamespaceDiscoveredDevicesUpdate_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.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) - { - using( NoSynchronizationContext ) - { - global::System.Net.Http.HttpResponseMessage _response = null; - try - { - // this operation supports x-ms-long-running-operation - var _originalUri = request.RequestUri.AbsoluteUri; - var sendTask = sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // 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.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - break; - } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.NamespaceDiscoveredDevice.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } - } - finally - { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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 value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of the namespace. - /// The name of the discovered device. - /// The resource properties to be updated. - /// 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 NamespaceDiscoveredDevicesUpdate_Validate(string subscriptionId, string resourceGroupName, string namespaceName, string discoveredDeviceName, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDiscoveredDeviceUpdate body, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener) - { - using( NoSynchronizationContext ) - { - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); - await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); - await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); - await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); - await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertNotNull(nameof(namespaceName),namespaceName); - await eventListener.AssertMinimumLength(nameof(namespaceName),namespaceName,3); - await eventListener.AssertMaximumLength(nameof(namespaceName),namespaceName,64); - await eventListener.AssertRegEx(nameof(namespaceName), namespaceName, @"^[a-z0-9][a-z0-9-]*[a-z0-9]$"); - await eventListener.AssertNotNull(nameof(discoveredDeviceName),discoveredDeviceName); - await eventListener.AssertMinimumLength(nameof(discoveredDeviceName),discoveredDeviceName,3); - await eventListener.AssertMaximumLength(nameof(discoveredDeviceName),discoveredDeviceName,63); - await eventListener.AssertRegEx(nameof(discoveredDeviceName), discoveredDeviceName, @"^[a-z0-9][a-z0-9-]*[a-z0-9]$"); - await eventListener.AssertNotNull(nameof(body), body); - await eventListener.AssertObjectIsValid(nameof(body), body); - } - } - - /// replace a Namespace - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of the namespace. - /// Resource create parameters. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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 NamespacesCreateOrReplace(string subscriptionId, string resourceGroupName, string namespaceName, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespace body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeUpdate) - { - var apiVersion = @"2025-11-01-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.DeviceRegistry/namespaces/" - + global::System.Uri.EscapeDataString(namespaceName) - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.Method.Put, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.NamespacesCreateOrReplace_Call (request, onOk,onDefault,eventListener,sender); - } - } - - /// replace a Namespace - /// - /// Resource create parameters. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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 NamespacesCreateOrReplaceViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespace body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeUpdate) - { - var apiVersion = @"2025-11-01-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.DeviceRegistry/namespaces/(?[^/]+)$", 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.DeviceRegistry/namespaces/{namespaceName}'"); - } - - // replace URI parameters with values from identity - var subscriptionId = _match.Groups["subscriptionId"].Value; - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var namespaceName = _match.Groups["namespaceName"].Value; - // construct URL - var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/subscriptions/" - + subscriptionId - + "/resourceGroups/" - + resourceGroupName - + "/providers/Microsoft.DeviceRegistry/namespaces/" - + namespaceName - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.Method.Put, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.NamespacesCreateOrReplace_Call (request, onOk,onDefault,eventListener,sender); - } - } - - /// replace a Namespace - /// - /// Resource create parameters. - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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 NamespacesCreateOrReplaceViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespace body, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeUpdate) - { - var apiVersion = @"2025-11-01-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.DeviceRegistry/namespaces/(?[^/]+)$", 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.DeviceRegistry/namespaces/{namespaceName}'"); - } - - // replace URI parameters with values from identity - var subscriptionId = _match.Groups["subscriptionId"].Value; - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var namespaceName = _match.Groups["namespaceName"].Value; - // construct URL - var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/subscriptions/" - + subscriptionId - + "/resourceGroups/" - + resourceGroupName - + "/providers/Microsoft.DeviceRegistry/namespaces/" - + namespaceName - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.Method.Put, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } - // make the call - return await this.NamespacesCreateOrReplaceWithResult_Call (request, eventListener,sender); - } - } - - /// replace a Namespace - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of the namespace. - /// Json string supplied to the NamespacesCreateOrReplace 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.DeviceRegistry.Runtime.ISendAsync pipeline to use to make the request. - /// - /// A that will be complete when handling of the response is completed. - /// - public async global::System.Threading.Tasks.Task NamespacesCreateOrReplaceViaJsonString(string subscriptionId, string resourceGroupName, string namespaceName, 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.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) - { - var apiVersion = @"2025-11-01-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.DeviceRegistry/namespaces/" - + global::System.Uri.EscapeDataString(namespaceName) - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.Method.Put, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.NamespacesCreateOrReplace_Call (request, onOk,onDefault,eventListener,sender); - } - } - - /// replace a Namespace - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of the namespace. - /// Json string supplied to the NamespacesCreateOrReplace operation - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync pipeline to use to make the request. - /// - /// A that will be complete when handling of the response is completed. - /// - public async global::System.Threading.Tasks.Task NamespacesCreateOrReplaceViaJsonStringWithResult(string subscriptionId, string resourceGroupName, string namespaceName, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) - { - var apiVersion = @"2025-11-01-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.DeviceRegistry/namespaces/" - + global::System.Uri.EscapeDataString(namespaceName) - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.Method.Put, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } - // make the call - return await this.NamespacesCreateOrReplaceWithResult_Call (request, eventListener,sender); - } - } - - /// replace a Namespace - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of the namespace. - /// Resource create parameters. - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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 NamespacesCreateOrReplaceWithResult(string subscriptionId, string resourceGroupName, string namespaceName, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespace body, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeUpdate) - { - var apiVersion = @"2025-11-01-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.DeviceRegistry/namespaces/" - + global::System.Uri.EscapeDataString(namespaceName) - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.Method.Put, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } - // make the call - return await this.NamespacesCreateOrReplaceWithResult_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.DeviceRegistry.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 NamespacesCreateOrReplaceWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) - { - using( NoSynchronizationContext ) - { - global::System.Net.Http.HttpResponseMessage _response = null; - try - { - // this operation supports x-ms-long-running-operation - var _originalUri = request.RequestUri.AbsoluteUri; - var sendTask = sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return null; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - // declared final-state-via: azure-async-operation - var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - var location = _response.GetFirstHeader(@"Location"); - var operationLocation = _response.GetFirstHeader(@"Operation-Location"); - while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) - { - // delay before making the next polling request - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - break; - } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.Namespace.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode.Parse(body.Result)) ); - return await _result; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.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 NamespacesCreateOrReplace_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.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) - { - using( NoSynchronizationContext ) - { - global::System.Net.Http.HttpResponseMessage _response = null; - try - { - // this operation supports x-ms-long-running-operation - var _originalUri = request.RequestUri.AbsoluteUri; - var sendTask = sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // 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.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - break; - } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.Namespace.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } - } - finally - { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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 value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of the namespace. - /// Resource create parameters. - /// 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 NamespacesCreateOrReplace_Validate(string subscriptionId, string resourceGroupName, string namespaceName, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespace body, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener) - { - using( NoSynchronizationContext ) - { - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); - await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); - await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); - await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); - await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertNotNull(nameof(namespaceName),namespaceName); - await eventListener.AssertMinimumLength(nameof(namespaceName),namespaceName,3); - await eventListener.AssertMaximumLength(nameof(namespaceName),namespaceName,64); - await eventListener.AssertRegEx(nameof(namespaceName), namespaceName, @"^[a-z0-9][a-z0-9-]*[a-z0-9]$"); - await eventListener.AssertNotNull(nameof(body), body); - await eventListener.AssertObjectIsValid(nameof(body), body); - } - } - - /// Delete a Namespace - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of the namespace. - /// 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.DeviceRegistry.Runtime.ISendAsync pipeline to use to make the request. - /// - /// A that will be complete when handling of the response is completed. - /// - public async global::System.Threading.Tasks.Task NamespacesDelete(string subscriptionId, string resourceGroupName, string namespaceName, global::System.Func onNoContent, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) - { - var apiVersion = @"2025-11-01-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.DeviceRegistry/namespaces/" - + global::System.Uri.EscapeDataString(namespaceName) - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.Method.Delete, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.NamespacesDelete_Call (request, onNoContent,onOk,onDefault,eventListener,sender); - } - } - - /// Delete a Namespace - /// - /// 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.DeviceRegistry.Runtime.ISendAsync pipeline to use to make the request. - /// - /// A that will be complete when handling of the response is completed. - /// - public async global::System.Threading.Tasks.Task NamespacesDeleteViaIdentity(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.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) - { - var apiVersion = @"2025-11-01-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.DeviceRegistry/namespaces/(?[^/]+)$", 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.DeviceRegistry/namespaces/{namespaceName}'"); - } - - // replace URI parameters with values from identity - var subscriptionId = _match.Groups["subscriptionId"].Value; - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var namespaceName = _match.Groups["namespaceName"].Value; - // construct URL - var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/subscriptions/" - + subscriptionId - + "/resourceGroups/" - + resourceGroupName - + "/providers/Microsoft.DeviceRegistry/namespaces/" - + namespaceName - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.Method.Delete, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.NamespacesDelete_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.DeviceRegistry.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 NamespacesDelete_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.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) - { - using( NoSynchronizationContext ) - { - global::System.Net.Http.HttpResponseMessage _response = null; - try - { - // this operation supports x-ms-long-running-operation - var _originalUri = request.RequestUri.AbsoluteUri; - var sendTask = sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // 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.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - break; - } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onNoContent(_response); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } - } - finally - { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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 value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of the namespace. - /// 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 NamespacesDelete_Validate(string subscriptionId, string resourceGroupName, string namespaceName, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener) - { - using( NoSynchronizationContext ) - { - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); - await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); - await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); - await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); - await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertNotNull(nameof(namespaceName),namespaceName); - await eventListener.AssertMinimumLength(nameof(namespaceName),namespaceName,3); - await eventListener.AssertMaximumLength(nameof(namespaceName),namespaceName,64); - await eventListener.AssertRegEx(nameof(namespaceName), namespaceName, @"^[a-z0-9][a-z0-9-]*[a-z0-9]$"); - } - } - - /// Get a Namespace - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of the namespace. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync pipeline to use to make the request. - /// - /// A that will be complete when handling of the response is completed. - /// - public async global::System.Threading.Tasks.Task NamespacesGet(string subscriptionId, string resourceGroupName, string namespaceName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) - { - var apiVersion = @"2025-11-01-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.DeviceRegistry/namespaces/" - + global::System.Uri.EscapeDataString(namespaceName) - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.NamespacesGet_Call (request, onOk,onDefault,eventListener,sender); - } - } - - /// Get a Namespace - /// - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync pipeline to use to make the request. - /// - /// A that will be complete when handling of the response is completed. - /// - public async global::System.Threading.Tasks.Task NamespacesGetViaIdentity(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.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) - { - var apiVersion = @"2025-11-01-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.DeviceRegistry/namespaces/(?[^/]+)$", 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.DeviceRegistry/namespaces/{namespaceName}'"); - } - - // replace URI parameters with values from identity - var subscriptionId = _match.Groups["subscriptionId"].Value; - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var namespaceName = _match.Groups["namespaceName"].Value; - // construct URL - var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/subscriptions/" - + subscriptionId - + "/resourceGroups/" - + resourceGroupName - + "/providers/Microsoft.DeviceRegistry/namespaces/" - + namespaceName - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.NamespacesGet_Call (request, onOk,onDefault,eventListener,sender); - } - } - - /// Get a Namespace - /// - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync pipeline to use to make the request. - /// - /// A that will be complete when handling of the response is completed. - /// - public async global::System.Threading.Tasks.Task NamespacesGetViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) - { - var apiVersion = @"2025-11-01-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.DeviceRegistry/namespaces/(?[^/]+)$", 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.DeviceRegistry/namespaces/{namespaceName}'"); - } - - // replace URI parameters with values from identity - var subscriptionId = _match.Groups["subscriptionId"].Value; - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var namespaceName = _match.Groups["namespaceName"].Value; - // construct URL - var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/subscriptions/" - + subscriptionId - + "/resourceGroups/" - + resourceGroupName - + "/providers/Microsoft.DeviceRegistry/namespaces/" - + namespaceName - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } - // make the call - return await this.NamespacesGetWithResult_Call (request, eventListener,sender); - } - } - - /// Get a Namespace - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of the namespace. - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync pipeline to use to make the request. - /// - /// A that will be complete when handling of the response is completed. - /// - public async global::System.Threading.Tasks.Task NamespacesGetWithResult(string subscriptionId, string resourceGroupName, string namespaceName, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) - { - var apiVersion = @"2025-11-01-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.DeviceRegistry/namespaces/" - + global::System.Uri.EscapeDataString(namespaceName) - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } - // make the call - return await this.NamespacesGetWithResult_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.DeviceRegistry.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 NamespacesGetWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.Namespace.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode.Parse(body.Result)) ); - return await _result; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.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 NamespacesGet_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.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.Namespace.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } - } - finally - { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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 value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of the namespace. - /// 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 NamespacesGet_Validate(string subscriptionId, string resourceGroupName, string namespaceName, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener) - { - using( NoSynchronizationContext ) - { - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); - await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); - await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); - await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); - await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertNotNull(nameof(namespaceName),namespaceName); - await eventListener.AssertMinimumLength(nameof(namespaceName),namespaceName,3); - await eventListener.AssertMaximumLength(nameof(namespaceName),namespaceName,64); - await eventListener.AssertRegEx(nameof(namespaceName), namespaceName, @"^[a-z0-9][a-z0-9-]*[a-z0-9]$"); - } - } - - /// List Namespace resources by resource group - /// The ID of the target subscription. The value must be an UUID. - /// 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.DeviceRegistry.Runtime.ISendAsync pipeline to use to make the request. - /// - /// A that will be complete when handling of the response is completed. - /// - public async global::System.Threading.Tasks.Task NamespacesListByResourceGroup(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.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) - { - var apiVersion = @"2025-11-01-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.DeviceRegistry/namespaces" - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.NamespacesListByResourceGroup_Call (request, onOk,onDefault,eventListener,sender); - } - } - - /// List Namespace resources by 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 - /// elsewhere). - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync pipeline to use to make the request. - /// - /// A that will be complete when handling of the response is completed. - /// - public async global::System.Threading.Tasks.Task NamespacesListByResourceGroupViaIdentity(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.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) - { - var apiVersion = @"2025-11-01-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.DeviceRegistry/namespaces$", 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.DeviceRegistry/namespaces'"); - } - - // 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.DeviceRegistry/namespaces" - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.NamespacesListByResourceGroup_Call (request, onOk,onDefault,eventListener,sender); - } - } - - /// List Namespace resources by resource group - /// - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync pipeline to use to make the request. - /// - /// A that will be complete when handling of the response is completed. - /// - public async global::System.Threading.Tasks.Task NamespacesListByResourceGroupViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) - { - var apiVersion = @"2025-11-01-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.DeviceRegistry/namespaces$", 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.DeviceRegistry/namespaces'"); - } - - // 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.DeviceRegistry/namespaces" - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } - // make the call - return await this.NamespacesListByResourceGroupWithResult_Call (request, eventListener,sender); - } - } - - /// List Namespace resources by resource group - /// The ID of the target subscription. The value must be an UUID. - /// 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.DeviceRegistry.Runtime.ISendAsync pipeline to use to make the request. - /// - /// A that will be complete when handling of the response is completed. - /// - public async global::System.Threading.Tasks.Task NamespacesListByResourceGroupWithResult(string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) - { - var apiVersion = @"2025-11-01-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.DeviceRegistry/namespaces" - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } - // make the call - return await this.NamespacesListByResourceGroupWithResult_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.DeviceRegistry.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 NamespacesListByResourceGroupWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.NamespaceListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode.Parse(body.Result)) ); - return await _result; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.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 NamespacesListByResourceGroup_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.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.NamespaceListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } - } - finally - { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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 value must be an UUID. - /// 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 NamespacesListByResourceGroup_Validate(string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener) - { - using( NoSynchronizationContext ) - { - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); - await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); - await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); - await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); - await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - } - } - - /// List Namespace resources by subscription ID - /// The ID of the target subscription. The value must be an UUID. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync pipeline to use to make the request. - /// - /// A that will be complete when handling of the response is completed. - /// - public async global::System.Threading.Tasks.Task NamespacesListBySubscription(string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) - { - var apiVersion = @"2025-11-01-preview"; - // Constant Parameters - using( NoSynchronizationContext ) - { - // construct URL - var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/subscriptions/" - + global::System.Uri.EscapeDataString(subscriptionId) - + "/providers/Microsoft.DeviceRegistry/namespaces" - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.NamespacesListBySubscription_Call (request, onOk,onDefault,eventListener,sender); - } - } - - /// List Namespace resources by subscription ID - /// - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync pipeline to use to make the request. - /// - /// A that will be complete when handling of the response is completed. - /// - public async global::System.Threading.Tasks.Task NamespacesListBySubscriptionViaIdentity(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.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) - { - var apiVersion = @"2025-11-01-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.DeviceRegistry/namespaces$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); - if (!_match.Success) - { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.DeviceRegistry/namespaces'"); - } - - // 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.DeviceRegistry/namespaces" - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.NamespacesListBySubscription_Call (request, onOk,onDefault,eventListener,sender); - } - } - - /// List Namespace resources by subscription ID - /// - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync pipeline to use to make the request. - /// - /// A that will be complete when handling of the response is completed. - /// - public async global::System.Threading.Tasks.Task NamespacesListBySubscriptionViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) - { - var apiVersion = @"2025-11-01-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.DeviceRegistry/namespaces$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); - if (!_match.Success) - { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.DeviceRegistry/namespaces'"); - } - - // 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.DeviceRegistry/namespaces" - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } - // make the call - return await this.NamespacesListBySubscriptionWithResult_Call (request, eventListener,sender); - } - } - - /// List Namespace resources by subscription ID - /// The ID of the target subscription. The value must be an UUID. - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync pipeline to use to make the request. - /// - /// A that will be complete when handling of the response is completed. - /// - public async global::System.Threading.Tasks.Task NamespacesListBySubscriptionWithResult(string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) - { - var apiVersion = @"2025-11-01-preview"; - // Constant Parameters - using( NoSynchronizationContext ) - { - // construct URL - var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/subscriptions/" - + global::System.Uri.EscapeDataString(subscriptionId) - + "/providers/Microsoft.DeviceRegistry/namespaces" - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } - // make the call - return await this.NamespacesListBySubscriptionWithResult_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.DeviceRegistry.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 NamespacesListBySubscriptionWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.NamespaceListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode.Parse(body.Result)) ); - return await _result; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.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 NamespacesListBySubscription_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.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.NamespaceListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } - } - finally - { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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 value must be an UUID. - /// 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 NamespacesListBySubscription_Validate(string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener) - { - using( NoSynchronizationContext ) - { - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); - await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); - } - } - - /// Migrate the resources into Namespace - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of the namespace. - /// The content of the action request - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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 NamespacesMigrate(string subscriptionId, string resourceGroupName, string namespaceName, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceMigrateRequest body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeUpdate) - { - var apiVersion = @"2025-11-01-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.DeviceRegistry/namespaces/" - + global::System.Uri.EscapeDataString(namespaceName) - + "/migrate" - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.Method.Post, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.NamespacesMigrate_Call (request, onOk,onDefault,eventListener,sender); - } - } - - /// Migrate the resources into Namespace - /// - /// The content of the action request - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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 NamespacesMigrateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceMigrateRequest body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeUpdate) - { - var apiVersion = @"2025-11-01-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.DeviceRegistry/namespaces/(?[^/]+)$", 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.DeviceRegistry/namespaces/{namespaceName}'"); - } - - // replace URI parameters with values from identity - var subscriptionId = _match.Groups["subscriptionId"].Value; - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var namespaceName = _match.Groups["namespaceName"].Value; - // construct URL - var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/subscriptions/" - + subscriptionId - + "/resourceGroups/" - + resourceGroupName - + "/providers/Microsoft.DeviceRegistry/namespaces/" - + namespaceName - + "/migrate" - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.Method.Post, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.NamespacesMigrate_Call (request, onOk,onDefault,eventListener,sender); - } - } - - /// Migrate the resources into Namespace - /// - /// The content of the action request - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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 NamespacesMigrateViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceMigrateRequest body, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeUpdate) - { - var apiVersion = @"2025-11-01-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.DeviceRegistry/namespaces/(?[^/]+)$", 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.DeviceRegistry/namespaces/{namespaceName}'"); - } - - // replace URI parameters with values from identity - var subscriptionId = _match.Groups["subscriptionId"].Value; - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var namespaceName = _match.Groups["namespaceName"].Value; - // construct URL - var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/subscriptions/" - + subscriptionId - + "/resourceGroups/" - + resourceGroupName - + "/providers/Microsoft.DeviceRegistry/namespaces/" - + namespaceName - + "/migrate" - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.Method.Post, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } - // make the call - return await this.NamespacesMigrateWithResult_Call (request, eventListener,sender); - } - } - - /// Migrate the resources into Namespace - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of the namespace. - /// Json string supplied to the NamespacesMigrate 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.DeviceRegistry.Runtime.ISendAsync pipeline to use to make the request. - /// - /// A that will be complete when handling of the response is completed. - /// - public async global::System.Threading.Tasks.Task NamespacesMigrateViaJsonString(string subscriptionId, string resourceGroupName, string namespaceName, 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.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) - { - var apiVersion = @"2025-11-01-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.DeviceRegistry/namespaces/" - + global::System.Uri.EscapeDataString(namespaceName) - + "/migrate" - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.Method.Post, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.NamespacesMigrate_Call (request, onOk,onDefault,eventListener,sender); - } - } - - /// Migrate the resources into Namespace - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of the namespace. - /// Json string supplied to the NamespacesMigrate operation - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync pipeline to use to make the request. - /// - /// A that will be complete when handling of the response is completed. - /// - public async global::System.Threading.Tasks.Task NamespacesMigrateViaJsonStringWithResult(string subscriptionId, string resourceGroupName, string namespaceName, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) - { - var apiVersion = @"2025-11-01-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.DeviceRegistry/namespaces/" - + global::System.Uri.EscapeDataString(namespaceName) - + "/migrate" - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.Method.Post, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } - // make the call - return await this.NamespacesMigrateWithResult_Call (request, eventListener,sender); - } - } - - /// Migrate the resources into Namespace - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of the namespace. - /// The content of the action request - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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 NamespacesMigrateWithResult(string subscriptionId, string resourceGroupName, string namespaceName, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceMigrateRequest body, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeUpdate) - { - var apiVersion = @"2025-11-01-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.DeviceRegistry/namespaces/" - + global::System.Uri.EscapeDataString(namespaceName) - + "/migrate" - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.Method.Post, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } - // make the call - return await this.NamespacesMigrateWithResult_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.DeviceRegistry.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 NamespacesMigrateWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) - { - using( NoSynchronizationContext ) - { - global::System.Net.Http.HttpResponseMessage _response = null; - try - { - // this operation supports x-ms-long-running-operation - var _originalUri = request.RequestUri.AbsoluteUri; - var sendTask = sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return null; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - // declared final-state-via: location - var _finalUri = _response.GetFirstHeader(@"Location"); - var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - var location = _response.GetFirstHeader(@"Location"); - var operationLocation = _response.GetFirstHeader(@"Operation-Location"); - while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) - { - // delay before making the next polling request - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - break; - } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.NamespaceMigrateResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode.Parse(body.Result)) ); - return await _result; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.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 NamespacesMigrate_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.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) - { - using( NoSynchronizationContext ) - { - global::System.Net.Http.HttpResponseMessage _response = null; - try - { - // this operation supports x-ms-long-running-operation - var _originalUri = request.RequestUri.AbsoluteUri; - var sendTask = sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // 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.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - break; - } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.NamespaceMigrateResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } - } - finally - { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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 value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of the namespace. - /// The content of the action request - /// 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 NamespacesMigrate_Validate(string subscriptionId, string resourceGroupName, string namespaceName, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceMigrateRequest body, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener) - { - using( NoSynchronizationContext ) - { - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); - await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); - await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); - await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); - await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertNotNull(nameof(namespaceName),namespaceName); - await eventListener.AssertMinimumLength(nameof(namespaceName),namespaceName,3); - await eventListener.AssertMaximumLength(nameof(namespaceName),namespaceName,64); - await eventListener.AssertRegEx(nameof(namespaceName), namespaceName, @"^[a-z0-9][a-z0-9-]*[a-z0-9]$"); - await eventListener.AssertNotNull(nameof(body), body); - await eventListener.AssertObjectIsValid(nameof(body), body); - } - } - - /// Update a Namespace - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of the namespace. - /// The resource properties to be updated. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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 NamespacesUpdate(string subscriptionId, string resourceGroupName, string namespaceName, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceUpdate body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeUpdate) - { - var apiVersion = @"2025-11-01-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.DeviceRegistry/namespaces/" - + global::System.Uri.EscapeDataString(namespaceName) - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.Method.Patch, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.NamespacesUpdate_Call (request, onOk,onDefault,eventListener,sender); - } - } - - /// Update a Namespace - /// - /// The resource properties to be updated. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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 NamespacesUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceUpdate body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeUpdate) - { - var apiVersion = @"2025-11-01-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.DeviceRegistry/namespaces/(?[^/]+)$", 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.DeviceRegistry/namespaces/{namespaceName}'"); - } - - // replace URI parameters with values from identity - var subscriptionId = _match.Groups["subscriptionId"].Value; - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var namespaceName = _match.Groups["namespaceName"].Value; - // construct URL - var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/subscriptions/" - + subscriptionId - + "/resourceGroups/" - + resourceGroupName - + "/providers/Microsoft.DeviceRegistry/namespaces/" - + namespaceName - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.Method.Patch, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.NamespacesUpdate_Call (request, onOk,onDefault,eventListener,sender); - } - } - - /// Update a Namespace - /// - /// The resource properties to be updated. - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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 NamespacesUpdateViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceUpdate body, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeUpdate) - { - var apiVersion = @"2025-11-01-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.DeviceRegistry/namespaces/(?[^/]+)$", 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.DeviceRegistry/namespaces/{namespaceName}'"); - } - - // replace URI parameters with values from identity - var subscriptionId = _match.Groups["subscriptionId"].Value; - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var namespaceName = _match.Groups["namespaceName"].Value; - // construct URL - var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/subscriptions/" - + subscriptionId - + "/resourceGroups/" - + resourceGroupName - + "/providers/Microsoft.DeviceRegistry/namespaces/" - + namespaceName - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.Method.Patch, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } - // make the call - return await this.NamespacesUpdateWithResult_Call (request, eventListener,sender); - } - } - - /// Update a Namespace - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of the namespace. - /// Json string supplied to the NamespacesUpdate 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.DeviceRegistry.Runtime.ISendAsync pipeline to use to make the request. - /// - /// A that will be complete when handling of the response is completed. - /// - public async global::System.Threading.Tasks.Task NamespacesUpdateViaJsonString(string subscriptionId, string resourceGroupName, string namespaceName, 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.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) - { - var apiVersion = @"2025-11-01-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.DeviceRegistry/namespaces/" - + global::System.Uri.EscapeDataString(namespaceName) - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.Method.Patch, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.NamespacesUpdate_Call (request, onOk,onDefault,eventListener,sender); - } - } - - /// Update a Namespace - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of the namespace. - /// Json string supplied to the NamespacesUpdate operation - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync pipeline to use to make the request. - /// - /// A that will be complete when handling of the response is completed. - /// - public async global::System.Threading.Tasks.Task NamespacesUpdateViaJsonStringWithResult(string subscriptionId, string resourceGroupName, string namespaceName, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) - { - var apiVersion = @"2025-11-01-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.DeviceRegistry/namespaces/" - + global::System.Uri.EscapeDataString(namespaceName) - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.Method.Patch, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } - // make the call - return await this.NamespacesUpdateWithResult_Call (request, eventListener,sender); - } - } - - /// Update a Namespace - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of the namespace. - /// The resource properties to be updated. - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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 NamespacesUpdateWithResult(string subscriptionId, string resourceGroupName, string namespaceName, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceUpdate body, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeUpdate) - { - var apiVersion = @"2025-11-01-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.DeviceRegistry/namespaces/" - + global::System.Uri.EscapeDataString(namespaceName) - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.Method.Patch, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } - // make the call - return await this.NamespacesUpdateWithResult_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.DeviceRegistry.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 NamespacesUpdateWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) - { - using( NoSynchronizationContext ) - { - global::System.Net.Http.HttpResponseMessage _response = null; - try - { - // this operation supports x-ms-long-running-operation - var _originalUri = request.RequestUri.AbsoluteUri; - var sendTask = sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return null; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - // declared final-state-via: location - var _finalUri = _response.GetFirstHeader(@"Location"); - var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - var location = _response.GetFirstHeader(@"Location"); - var operationLocation = _response.GetFirstHeader(@"Operation-Location"); - while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) - { - // delay before making the next polling request - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - break; - } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.Namespace.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode.Parse(body.Result)) ); - return await _result; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.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 NamespacesUpdate_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.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) - { - using( NoSynchronizationContext ) - { - global::System.Net.Http.HttpResponseMessage _response = null; - try - { - // this operation supports x-ms-long-running-operation - var _originalUri = request.RequestUri.AbsoluteUri; - var sendTask = sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // 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.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - break; - } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.Namespace.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } - } - finally - { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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 value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of the namespace. - /// The resource properties to be updated. - /// 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 NamespacesUpdate_Validate(string subscriptionId, string resourceGroupName, string namespaceName, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceUpdate body, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener) - { - using( NoSynchronizationContext ) - { - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); - await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); - await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); - await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); - await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertNotNull(nameof(namespaceName),namespaceName); - await eventListener.AssertMinimumLength(nameof(namespaceName),namespaceName,3); - await eventListener.AssertMaximumLength(nameof(namespaceName),namespaceName,64); - await eventListener.AssertRegEx(nameof(namespaceName), namespaceName, @"^[a-z0-9][a-z0-9-]*[a-z0-9]$"); - await eventListener.AssertNotNull(nameof(body), body); - await eventListener.AssertObjectIsValid(nameof(body), body); - } - } - - /// Returns the current status of an async operation. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the Azure region. - /// The ID of an ongoing async 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.DeviceRegistry.Runtime.ISendAsync pipeline to use to make the request. - /// - /// A that will be complete when handling of the response is completed. - /// - public async global::System.Threading.Tasks.Task OperationStatusGet(string subscriptionId, string location, string operationId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) - { - var apiVersion = @"2025-11-01-preview"; - // Constant Parameters - using( NoSynchronizationContext ) - { - // construct URL - var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/subscriptions/" - + global::System.Uri.EscapeDataString(subscriptionId) - + "/providers/Microsoft.DeviceRegistry/locations/" - + global::System.Uri.EscapeDataString(location) - + "/operationStatuses/" - + global::System.Uri.EscapeDataString(operationId) - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.OperationStatusGet_Call (request, onOk,onDefault,eventListener,sender); - } - } - - /// Returns the current status of an async 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.DeviceRegistry.Runtime.ISendAsync pipeline to use to make the request. - /// - /// A that will be complete when handling of the response is completed. - /// - public async global::System.Threading.Tasks.Task OperationStatusGetViaIdentity(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.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) - { - var apiVersion = @"2025-11-01-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.DeviceRegistry/locations/(?[^/]+)/operationStatuses/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); - if (!_match.Success) - { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.DeviceRegistry/locations/{location}/operationStatuses/{operationId}'"); - } - - // replace URI parameters with values from identity - var subscriptionId = _match.Groups["subscriptionId"].Value; - var location = _match.Groups["location"].Value; - var operationId = _match.Groups["operationId"].Value; - // construct URL - var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/subscriptions/" - + subscriptionId - + "/providers/Microsoft.DeviceRegistry/locations/" - + location - + "/operationStatuses/" - + operationId - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.OperationStatusGet_Call (request, onOk,onDefault,eventListener,sender); - } - } - - /// Returns the current status of an async operation. - /// - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync pipeline to use to make the request. - /// - /// A that will be complete when handling of the response is completed. - /// - public async global::System.Threading.Tasks.Task OperationStatusGetViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) - { - var apiVersion = @"2025-11-01-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.DeviceRegistry/locations/(?[^/]+)/operationStatuses/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); - if (!_match.Success) - { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.DeviceRegistry/locations/{location}/operationStatuses/{operationId}'"); - } - - // replace URI parameters with values from identity - var subscriptionId = _match.Groups["subscriptionId"].Value; - var location = _match.Groups["location"].Value; - var operationId = _match.Groups["operationId"].Value; - // construct URL - var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/subscriptions/" - + subscriptionId - + "/providers/Microsoft.DeviceRegistry/locations/" - + location - + "/operationStatuses/" - + operationId - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } - // make the call - return await this.OperationStatusGetWithResult_Call (request, eventListener,sender); - } - } - - /// Returns the current status of an async operation. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the Azure region. - /// The ID of an ongoing async operation. - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync pipeline to use to make the request. - /// - /// A that will be complete when handling of the response is completed. - /// - public async global::System.Threading.Tasks.Task OperationStatusGetWithResult(string subscriptionId, string location, string operationId, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) - { - var apiVersion = @"2025-11-01-preview"; - // Constant Parameters - using( NoSynchronizationContext ) - { - // construct URL - var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/subscriptions/" - + global::System.Uri.EscapeDataString(subscriptionId) - + "/providers/Microsoft.DeviceRegistry/locations/" - + global::System.Uri.EscapeDataString(location) - + "/operationStatuses/" - + global::System.Uri.EscapeDataString(operationId) - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } - // make the call - return await this.OperationStatusGetWithResult_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.DeviceRegistry.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 OperationStatusGetWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.OperationStatusResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode.Parse(body.Result)) ); - return await _result; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.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 OperationStatusGet_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.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.OperationStatusResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } - } - finally - { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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 value must be an UUID. - /// The name of the Azure region. - /// The ID of an ongoing async 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 OperationStatusGet_Validate(string subscriptionId, string location, string operationId, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener) - { - using( NoSynchronizationContext ) - { - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); - await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); - await eventListener.AssertNotNull(nameof(location),location); - await eventListener.AssertMinimumLength(nameof(location),location,1); - await eventListener.AssertNotNull(nameof(operationId),operationId); - await eventListener.AssertMinimumLength(nameof(operationId),operationId,1); - } - } - - /// List the operations for the provider - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync pipeline to use to make the request. - /// - /// A that will be complete when handling of the response is completed. - /// - public async global::System.Threading.Tasks.Task OperationsList(global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) - { - var apiVersion = @"2025-11-01-preview"; - // Constant Parameters - using( NoSynchronizationContext ) - { - // construct URL - var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/providers/Microsoft.DeviceRegistry/operations" - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.OperationsList_Call (request, onOk,onDefault,eventListener,sender); - } - } - - /// List the operations for the provider - /// - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync pipeline to use to make the request. - /// - /// A that will be complete when handling of the response is completed. - /// - public async global::System.Threading.Tasks.Task OperationsListViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) - { - var apiVersion = @"2025-11-01-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.DeviceRegistry/operations$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); - if (!_match.Success) - { - throw new global::System.Exception("Invalid identity for URI '/providers/Microsoft.DeviceRegistry/operations'"); - } - - // replace URI parameters with values from identity - // construct URL - var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/providers/Microsoft.DeviceRegistry/operations" - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.OperationsList_Call (request, onOk,onDefault,eventListener,sender); - } - } - - /// List the operations for the provider - /// - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync pipeline to 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.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) - { - var apiVersion = @"2025-11-01-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.DeviceRegistry/operations$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); - if (!_match.Success) - { - throw new global::System.Exception("Invalid identity for URI '/providers/Microsoft.DeviceRegistry/operations'"); - } - - // replace URI parameters with values from identity - // construct URL - var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/providers/Microsoft.DeviceRegistry/operations" - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } - // make the call - return await this.OperationsListWithResult_Call (request, eventListener,sender); - } - } - - /// List the operations for the provider - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync pipeline to 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.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) - { - var apiVersion = @"2025-11-01-preview"; - // Constant Parameters - using( NoSynchronizationContext ) - { - // construct URL - var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/providers/Microsoft.DeviceRegistry/operations" - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } - // make the call - return await this.OperationsListWithResult_Call (request, eventListener,sender); - } - } - - /// Actual wire call for method. - /// the prepared HttpRequestMessage to send. - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task NamespacesListBySubscriptionWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -20773,7 +16416,7 @@ public partial class DeviceRegistry case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.OperationListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode.Parse(body.Result)) ); + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.NamespaceListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode.Parse(body.Result)) ); return await _result; } default: @@ -20806,7 +16449,7 @@ public partial class DeviceRegistry } } - /// 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 @@ -20816,7 +16459,7 @@ public partial class DeviceRegistry /// /// 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.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task NamespacesListBySubscription_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.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -20835,7 +16478,7 @@ public partial class DeviceRegistry case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.OperationListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.NamespaceListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: @@ -20857,27 +16500,28 @@ public partial class DeviceRegistry } /// - /// 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 value must be an UUID. /// 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.DeviceRegistry.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task NamespacesListBySubscription_Validate(string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { - + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); } } - /// update a Policy + /// Migrate the resources into Namespace /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// The name of the namespace. - /// The name of the Policy tracked resource. - /// Resource create parameters. + /// The content of the action request /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). @@ -20887,9 +16531,9 @@ public partial class DeviceRegistry /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task PoliciesCreateOrUpdate(string subscriptionId, string resourceGroupName, string namespaceName, string policyName, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicy body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeUpdate) + public async global::System.Threading.Tasks.Task NamespacesMigrate(string subscriptionId, string resourceGroupName, string namespaceName, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceMigrateRequest body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -20901,8 +16545,7 @@ public partial class DeviceRegistry + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.DeviceRegistry/namespaces/" + global::System.Uri.EscapeDataString(namespaceName) - + "/credentials/default/policies/" - + global::System.Uri.EscapeDataString(policyName) + + "/migrate" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -20911,7 +16554,7 @@ public partial class DeviceRegistry // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Method.Put, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Method.Post, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } @@ -20920,13 +16563,13 @@ public partial class DeviceRegistry request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.PoliciesCreateOrUpdate_Call (request, onOk,onDefault,eventListener,sender); + await this.NamespacesMigrate_Call (request, onOk,onDefault,eventListener,sender); } } - /// update a Policy + /// Migrate the resources into Namespace /// - /// Resource create parameters. + /// The content of the action request /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). @@ -20936,25 +16579,24 @@ public partial class DeviceRegistry /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task PoliciesCreateOrUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicy body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeUpdate) + public async global::System.Threading.Tasks.Task NamespacesMigrateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceMigrateRequest body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.DeviceRegistry/namespaces/(?[^/]+)/credentials/default/policies/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.DeviceRegistry/namespaces/(?[^/]+)$", 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.DeviceRegistry/namespaces/{namespaceName}/credentials/default/policies/{policyName}'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; var namespaceName = _match.Groups["namespaceName"].Value; - var policyName = _match.Groups["policyName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" @@ -20963,8 +16605,7 @@ public partial class DeviceRegistry + resourceGroupName + "/providers/Microsoft.DeviceRegistry/namespaces/" + namespaceName - + "/credentials/default/policies/" - + policyName + + "/migrate" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -20973,7 +16614,7 @@ public partial class DeviceRegistry // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Method.Put, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Method.Post, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } @@ -20982,39 +16623,38 @@ public partial class DeviceRegistry request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.PoliciesCreateOrUpdate_Call (request, onOk,onDefault,eventListener,sender); + await this.NamespacesMigrate_Call (request, onOk,onDefault,eventListener,sender); } } - /// update a Policy + /// Migrate the resources into Namespace /// - /// Resource create parameters. + /// The content of the action request /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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 PoliciesCreateOrUpdateViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicy body, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeUpdate) + public async global::System.Threading.Tasks.Task NamespacesMigrateViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceMigrateRequest body, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.DeviceRegistry/namespaces/(?[^/]+)/credentials/default/policies/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.DeviceRegistry/namespaces/(?[^/]+)$", 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.DeviceRegistry/namespaces/{namespaceName}/credentials/default/policies/{policyName}'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; var namespaceName = _match.Groups["namespaceName"].Value; - var policyName = _match.Groups["policyName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" @@ -21023,8 +16663,7 @@ public partial class DeviceRegistry + resourceGroupName + "/providers/Microsoft.DeviceRegistry/namespaces/" + namespaceName - + "/credentials/default/policies/" - + policyName + + "/migrate" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -21033,7 +16672,7 @@ public partial class DeviceRegistry // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Method.Put, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Method.Post, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } @@ -21042,16 +16681,15 @@ public partial class DeviceRegistry request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - return await this.PoliciesCreateOrUpdateWithResult_Call (request, eventListener,sender); + return await this.NamespacesMigrateWithResult_Call (request, eventListener,sender); } } - /// update a Policy + /// Migrate the resources into Namespace /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// The name of the namespace. - /// The name of the Policy tracked resource. - /// Json string supplied to the PoliciesCreateOrUpdate operation + /// Json string supplied to the NamespacesMigrate 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). @@ -21060,9 +16698,9 @@ public partial class DeviceRegistry /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task PoliciesCreateOrUpdateViaJsonString(string subscriptionId, string resourceGroupName, string namespaceName, string policyName, 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.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task NamespacesMigrateViaJsonString(string subscriptionId, string resourceGroupName, string namespaceName, 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.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -21074,8 +16712,7 @@ public partial class DeviceRegistry + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.DeviceRegistry/namespaces/" + global::System.Uri.EscapeDataString(namespaceName) - + "/credentials/default/policies/" - + global::System.Uri.EscapeDataString(policyName) + + "/migrate" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -21084,7 +16721,7 @@ public partial class DeviceRegistry // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Method.Put, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Method.Post, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } @@ -21093,25 +16730,24 @@ public partial class DeviceRegistry request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.PoliciesCreateOrUpdate_Call (request, onOk,onDefault,eventListener,sender); + await this.NamespacesMigrate_Call (request, onOk,onDefault,eventListener,sender); } } - /// update a Policy + /// Migrate the resources into Namespace /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// The name of the namespace. - /// The name of the Policy tracked resource. - /// Json string supplied to the PoliciesCreateOrUpdate operation + /// Json string supplied to the NamespacesMigrate operation /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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 PoliciesCreateOrUpdateViaJsonStringWithResult(string subscriptionId, string resourceGroupName, string namespaceName, string policyName, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task NamespacesMigrateViaJsonStringWithResult(string subscriptionId, string resourceGroupName, string namespaceName, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -21123,8 +16759,7 @@ public partial class DeviceRegistry + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.DeviceRegistry/namespaces/" + global::System.Uri.EscapeDataString(namespaceName) - + "/credentials/default/policies/" - + global::System.Uri.EscapeDataString(policyName) + + "/migrate" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -21133,7 +16768,7 @@ public partial class DeviceRegistry // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Method.Put, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Method.Post, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } @@ -21142,26 +16777,25 @@ public partial class DeviceRegistry request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - return await this.PoliciesCreateOrUpdateWithResult_Call (request, eventListener,sender); + return await this.NamespacesMigrateWithResult_Call (request, eventListener,sender); } } - /// update a Policy + /// Migrate the resources into Namespace /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// The name of the namespace. - /// The name of the Policy tracked resource. - /// Resource create parameters. + /// The content of the action request /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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 PoliciesCreateOrUpdateWithResult(string subscriptionId, string resourceGroupName, string namespaceName, string policyName, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicy body, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeUpdate) + public async global::System.Threading.Tasks.Task NamespacesMigrateWithResult(string subscriptionId, string resourceGroupName, string namespaceName, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceMigrateRequest body, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -21173,8 +16807,7 @@ public partial class DeviceRegistry + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.DeviceRegistry/namespaces/" + global::System.Uri.EscapeDataString(namespaceName) - + "/credentials/default/policies/" - + global::System.Uri.EscapeDataString(policyName) + + "/migrate" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -21183,7 +16816,7 @@ public partial class DeviceRegistry // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Method.Put, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Method.Post, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } @@ -21192,19 +16825,19 @@ public partial class DeviceRegistry request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - return await this.PoliciesCreateOrUpdateWithResult_Call (request, eventListener,sender); + return await this.NamespacesMigrateWithResult_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.DeviceRegistry.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 PoliciesCreateOrUpdateWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task NamespacesMigrateWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -21218,7 +16851,8 @@ public partial class DeviceRegistry await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return null; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - // declared final-state-via: azure-async-operation + // 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"); @@ -21297,7 +16931,7 @@ public partial class DeviceRegistry } // 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.DeviceRegistry.Runtime.Method.Get); + request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Method.Get); // drop the old response _response?.Dispose(); @@ -21315,7 +16949,7 @@ public partial class DeviceRegistry case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.Policy.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode.Parse(body.Result)) ); + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.NamespaceMigrateResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode.Parse(body.Result)) ); return await _result; } default: @@ -21348,7 +16982,7 @@ public partial class DeviceRegistry } } - /// 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 @@ -21358,7 +16992,7 @@ public partial class DeviceRegistry /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task PoliciesCreateOrUpdate_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.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task NamespacesMigrate_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.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -21372,7 +17006,8 @@ public partial class DeviceRegistry await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // declared final-state-via: azure-async-operation + // 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"); @@ -21451,7 +17086,7 @@ public partial class DeviceRegistry } // 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.DeviceRegistry.Runtime.Method.Get); + request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Method.Get); // drop the old response _response?.Dispose(); @@ -21469,7 +17104,7 @@ public partial class DeviceRegistry case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.Policy.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.NamespaceMigrateResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: @@ -21491,19 +17126,18 @@ public partial class DeviceRegistry } /// - /// 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 value must be an UUID. /// The name of the resource group. The name is case insensitive. /// The name of the namespace. - /// The name of the Policy tracked resource. - /// Resource create parameters. + /// The content of the action request /// 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 PoliciesCreateOrUpdate_Validate(string subscriptionId, string resourceGroupName, string namespaceName, string policyName, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicy body, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task NamespacesMigrate_Validate(string subscriptionId, string resourceGroupName, string namespaceName, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceMigrateRequest body, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -21516,32 +17150,28 @@ public partial class DeviceRegistry await eventListener.AssertMinimumLength(nameof(namespaceName),namespaceName,3); await eventListener.AssertMaximumLength(nameof(namespaceName),namespaceName,64); await eventListener.AssertRegEx(nameof(namespaceName), namespaceName, @"^[a-z0-9][a-z0-9-]*[a-z0-9]$"); - await eventListener.AssertNotNull(nameof(policyName),policyName); - await eventListener.AssertMinimumLength(nameof(policyName),policyName,3); - await eventListener.AssertMaximumLength(nameof(policyName),policyName,63); - await eventListener.AssertRegEx(nameof(policyName), policyName, @"^[0-9a-zA-Z][a-zA-Z0-9-]*$"); await eventListener.AssertNotNull(nameof(body), body); await eventListener.AssertObjectIsValid(nameof(body), body); } } - /// Delete a Policy + /// Update a Namespace /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// The name of the namespace. - /// The name of the Policy tracked resource. - /// a delegate that is called when the remote service returns 204 (NoContent). + /// The resource properties to be updated. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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 PoliciesDelete(string subscriptionId, string resourceGroupName, string namespaceName, string policyName, global::System.Func onNoContent, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task NamespacesUpdate(string subscriptionId, string resourceGroupName, string namespaceName, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceUpdate body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -21553,8 +17183,6 @@ public partial class DeviceRegistry + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.DeviceRegistry/namespaces/" + global::System.Uri.EscapeDataString(namespaceName) - + "/credentials/default/policies/" - + global::System.Uri.EscapeDataString(policyName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -21563,45 +17191,49 @@ public partial class DeviceRegistry // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Method.Delete, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Method.Patch, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.PoliciesDelete_Call (request, onNoContent,onOk,onDefault,eventListener,sender); + await this.NamespacesUpdate_Call (request, onOk,onDefault,eventListener,sender); } } - /// Delete a Policy + /// Update a Namespace /// - /// a delegate that is called when the remote service returns 204 (NoContent). + /// The resource properties to be updated. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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 PoliciesDeleteViaIdentity(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.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task NamespacesUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceUpdate body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.DeviceRegistry/namespaces/(?[^/]+)/credentials/default/policies/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.DeviceRegistry/namespaces/(?[^/]+)$", 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.DeviceRegistry/namespaces/{namespaceName}/credentials/default/policies/{policyName}'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; var namespaceName = _match.Groups["namespaceName"].Value; - var policyName = _match.Groups["policyName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" @@ -21610,8 +17242,6 @@ public partial class DeviceRegistry + resourceGroupName + "/providers/Microsoft.DeviceRegistry/namespaces/" + namespaceName - + "/credentials/default/policies/" - + policyName + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -21620,245 +17250,81 @@ public partial class DeviceRegistry // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Method.Delete, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Method.Patch, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.PoliciesDelete_Call (request, onNoContent,onOk,onDefault,eventListener,sender); + await this.NamespacesUpdate_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 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). + /// Update a Namespace + /// + /// The resource properties to be updated. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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 PoliciesDelete_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.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task NamespacesUpdateViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceUpdate body, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeUpdate) { + var apiVersion = @"2025-10-01"; + // Constant Parameters using( NoSynchronizationContext ) { - global::System.Net.Http.HttpResponseMessage _response = null; - try - { - // this operation supports x-ms-long-running-operation - var _originalUri = request.RequestUri.AbsoluteUri; - var sendTask = sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // 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.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - break; - } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } - var _contentType = _response.Content.Headers.ContentType?.MediaType; + // verify that Identity format is an exact match for uri - switch ( _response.StatusCode ) - { - case global::System.Net.HttpStatusCode.OK: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onNoContent(_response); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } - } - finally + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.DeviceRegistry/namespaces/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}'"); } - } - } - - /// - /// Validation method for method. Call this like the actual call, but you will get validation - /// events back. - /// - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of the namespace. - /// The name of the Policy tracked 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 PoliciesDelete_Validate(string subscriptionId, string resourceGroupName, string namespaceName, string policyName, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener) - { - using( NoSynchronizationContext ) - { - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); - await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); - await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); - await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); - await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertNotNull(nameof(namespaceName),namespaceName); - await eventListener.AssertMinimumLength(nameof(namespaceName),namespaceName,3); - await eventListener.AssertMaximumLength(nameof(namespaceName),namespaceName,64); - await eventListener.AssertRegEx(nameof(namespaceName), namespaceName, @"^[a-z0-9][a-z0-9-]*[a-z0-9]$"); - await eventListener.AssertNotNull(nameof(policyName),policyName); - await eventListener.AssertMinimumLength(nameof(policyName),policyName,3); - await eventListener.AssertMaximumLength(nameof(policyName),policyName,63); - await eventListener.AssertRegEx(nameof(policyName), policyName, @"^[0-9a-zA-Z][a-zA-Z0-9-]*$"); - } - } - /// Get a Policy - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of the namespace. - /// The name of the Policy tracked 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.DeviceRegistry.Runtime.ISendAsync pipeline to use to make the request. - /// - /// A that will be complete when handling of the response is completed. - /// - public async global::System.Threading.Tasks.Task PoliciesGet(string subscriptionId, string resourceGroupName, string namespaceName, string policyName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) - { - var apiVersion = @"2025-11-01-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 namespaceName = _match.Groups["namespaceName"].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.DeviceRegistry/namespaces/" - + global::System.Uri.EscapeDataString(namespaceName) - + "/credentials/default/policies/" - + global::System.Uri.EscapeDataString(policyName) + + namespaceName + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.PoliciesGet_Call (request, onOk,onDefault,eventListener,sender); + return await this.NamespacesUpdateWithResult_Call (request, eventListener,sender); } } - /// Get a Policy - /// + /// Update a Namespace + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the namespace. + /// Json string supplied to the NamespacesUpdate 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). @@ -21867,35 +17333,20 @@ public partial class DeviceRegistry /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task PoliciesGetViaIdentity(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.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task NamespacesUpdateViaJsonString(string subscriptionId, string resourceGroupName, string namespaceName, 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.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { - // verify that Identity format is an exact match for uri - - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.DeviceRegistry/namespaces/(?[^/]+)/credentials/default/policies/(?[^/]+)$", 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.DeviceRegistry/namespaces/{namespaceName}/credentials/default/policies/{policyName}'"); - } - - // replace URI parameters with values from identity - var subscriptionId = _match.Groups["subscriptionId"].Value; - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var namespaceName = _match.Groups["namespaceName"].Value; - var policyName = _match.Groups["policyName"].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.DeviceRegistry/namespaces/" - + namespaceName - + "/credentials/default/policies/" - + policyName + + global::System.Uri.EscapeDataString(namespaceName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -21904,52 +17355,44 @@ public partial class DeviceRegistry // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Method.Get, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Method.Patch, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.PoliciesGet_Call (request, onOk,onDefault,eventListener,sender); + await this.NamespacesUpdate_Call (request, onOk,onDefault,eventListener,sender); } } - /// Get a Policy - /// + /// Update a Namespace + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the namespace. + /// Json string supplied to the NamespacesUpdate operation /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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 PoliciesGetViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task NamespacesUpdateViaJsonStringWithResult(string subscriptionId, string resourceGroupName, string namespaceName, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { - // verify that Identity format is an exact match for uri - - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.DeviceRegistry/namespaces/(?[^/]+)/credentials/default/policies/(?[^/]+)$", 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.DeviceRegistry/namespaces/{namespaceName}/credentials/default/policies/{policyName}'"); - } - - // replace URI parameters with values from identity - var subscriptionId = _match.Groups["subscriptionId"].Value; - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var namespaceName = _match.Groups["namespaceName"].Value; - var policyName = _match.Groups["policyName"].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.DeviceRegistry/namespaces/" - + namespaceName - + "/credentials/default/policies/" - + policyName + + global::System.Uri.EscapeDataString(namespaceName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -21958,29 +17401,34 @@ public partial class DeviceRegistry // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Method.Get, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Method.Patch, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - return await this.PoliciesGetWithResult_Call (request, eventListener,sender); + return await this.NamespacesUpdateWithResult_Call (request, eventListener,sender); } } - /// Get a Policy + /// Update a Namespace /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// The name of the namespace. - /// The name of the Policy tracked resource. + /// The resource properties to be updated. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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 PoliciesGetWithResult(string subscriptionId, string resourceGroupName, string namespaceName, string policyName, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task NamespacesUpdateWithResult(string subscriptionId, string resourceGroupName, string namespaceName, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceUpdate body, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -21992,8 +17440,6 @@ public partial class DeviceRegistry + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.DeviceRegistry/namespaces/" + global::System.Uri.EscapeDataString(namespaceName) - + "/credentials/default/policies/" - + global::System.Uri.EscapeDataString(policyName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -22002,34 +17448,131 @@ public partial class DeviceRegistry // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Method.Get, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Method.Patch, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - return await this.PoliciesGetWithResult_Call (request, eventListener,sender); + return await this.NamespacesUpdateWithResult_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.DeviceRegistry.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 PoliciesGetWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task NamespacesUpdateWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { global::System.Net.Http.HttpResponseMessage _response = null; try { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; var sendTask = sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return null; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + // declared final-state-via: location + var _finalUri = _response.GetFirstHeader(@"Location"); + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + break; + } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } var _contentType = _response.Content.Headers.ContentType?.MediaType; @@ -22038,7 +17581,7 @@ public partial class DeviceRegistry case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.Policy.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode.Parse(body.Result)) ); + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.Namespace.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode.Parse(body.Result)) ); return await _result; } default: @@ -22071,7 +17614,7 @@ public partial class DeviceRegistry } } - /// 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 @@ -22081,17 +17624,110 @@ public partial class DeviceRegistry /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task PoliciesGet_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.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task NamespacesUpdate_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.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { global::System.Net.Http.HttpResponseMessage _response = null; try { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; var sendTask = sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // 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.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; @@ -22100,7 +17736,7 @@ public partial class DeviceRegistry case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.Policy.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.Namespace.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: @@ -22122,18 +17758,18 @@ public partial class DeviceRegistry } /// - /// 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 value must be an UUID. /// The name of the resource group. The name is case insensitive. /// The name of the namespace. - /// The name of the Policy tracked resource. + /// The resource properties to be updated. /// 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 PoliciesGet_Validate(string subscriptionId, string resourceGroupName, string namespaceName, string policyName, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task NamespacesUpdate_Validate(string subscriptionId, string resourceGroupName, string namespaceName, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceUpdate body, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -22146,17 +17782,15 @@ public partial class DeviceRegistry await eventListener.AssertMinimumLength(nameof(namespaceName),namespaceName,3); await eventListener.AssertMaximumLength(nameof(namespaceName),namespaceName,64); await eventListener.AssertRegEx(nameof(namespaceName), namespaceName, @"^[a-z0-9][a-z0-9-]*[a-z0-9]$"); - await eventListener.AssertNotNull(nameof(policyName),policyName); - await eventListener.AssertMinimumLength(nameof(policyName),policyName,3); - await eventListener.AssertMaximumLength(nameof(policyName),policyName,63); - await eventListener.AssertRegEx(nameof(policyName), policyName, @"^[0-9a-zA-Z][a-zA-Z0-9-]*$"); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); } } - /// List Policy resources by Credential + /// Returns the current status of an async operation. /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of the namespace. + /// The name of the Azure region. + /// The ID of an ongoing async 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). @@ -22165,9 +17799,9 @@ public partial class DeviceRegistry /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task PoliciesListByResourceGroup(string subscriptionId, string resourceGroupName, string namespaceName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task OperationStatusGet(string subscriptionId, string location, string operationId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -22175,11 +17809,10 @@ public partial class DeviceRegistry var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + global::System.Uri.EscapeDataString(subscriptionId) - + "/resourceGroups/" - + global::System.Uri.EscapeDataString(resourceGroupName) - + "/providers/Microsoft.DeviceRegistry/namespaces/" - + global::System.Uri.EscapeDataString(namespaceName) - + "/credentials/default/policies" + + "/providers/Microsoft.DeviceRegistry/locations/" + + global::System.Uri.EscapeDataString(location) + + "/operationStatuses/" + + global::System.Uri.EscapeDataString(operationId) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -22193,11 +17826,11 @@ public partial class DeviceRegistry await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.PoliciesListByResourceGroup_Call (request, onOk,onDefault,eventListener,sender); + await this.OperationStatusGet_Call (request, onOk,onDefault,eventListener,sender); } } - /// List Policy resources by Credential + /// Returns the current status of an async 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 @@ -22207,33 +17840,32 @@ public partial class DeviceRegistry /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task PoliciesListByResourceGroupViaIdentity(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.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task OperationStatusGetViaIdentity(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.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.DeviceRegistry/namespaces/(?[^/]+)/credentials/default/policies$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/providers/Microsoft.DeviceRegistry/locations/(?[^/]+)/operationStatuses/(?[^/]+)$", 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.DeviceRegistry/namespaces/{namespaceName}/credentials/default/policies'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.DeviceRegistry/locations/{location}/operationStatuses/{operationId}'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var namespaceName = _match.Groups["namespaceName"].Value; + var location = _match.Groups["location"].Value; + var operationId = _match.Groups["operationId"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + subscriptionId - + "/resourceGroups/" - + resourceGroupName - + "/providers/Microsoft.DeviceRegistry/namespaces/" - + namespaceName - + "/credentials/default/policies" + + "/providers/Microsoft.DeviceRegistry/locations/" + + location + + "/operationStatuses/" + + operationId + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -22247,45 +17879,44 @@ public partial class DeviceRegistry await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.PoliciesListByResourceGroup_Call (request, onOk,onDefault,eventListener,sender); + await this.OperationStatusGet_Call (request, onOk,onDefault,eventListener,sender); } } - /// List Policy resources by Credential + /// Returns the current status of an async operation. /// /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync pipeline to use to make the request. /// - /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task PoliciesListByResourceGroupViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task OperationStatusGetViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.DeviceRegistry/namespaces/(?[^/]+)/credentials/default/policies$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/providers/Microsoft.DeviceRegistry/locations/(?[^/]+)/operationStatuses/(?[^/]+)$", 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.DeviceRegistry/namespaces/{namespaceName}/credentials/default/policies'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.DeviceRegistry/locations/{location}/operationStatuses/{operationId}'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var namespaceName = _match.Groups["namespaceName"].Value; + var location = _match.Groups["location"].Value; + var operationId = _match.Groups["operationId"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + subscriptionId - + "/resourceGroups/" - + resourceGroupName - + "/providers/Microsoft.DeviceRegistry/namespaces/" - + namespaceName - + "/credentials/default/policies" + + "/providers/Microsoft.DeviceRegistry/locations/" + + location + + "/operationStatuses/" + + operationId + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -22299,23 +17930,23 @@ public partial class DeviceRegistry await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - return await this.PoliciesListByResourceGroupWithResult_Call (request, eventListener,sender); + return await this.OperationStatusGetWithResult_Call (request, eventListener,sender); } } - /// List Policy resources by Credential + /// Returns the current status of an async operation. /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of the namespace. + /// The name of the Azure region. + /// The ID of an ongoing async operation. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync pipeline to use to make the request. /// - /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task PoliciesListByResourceGroupWithResult(string subscriptionId, string resourceGroupName, string namespaceName, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task OperationStatusGetWithResult(string subscriptionId, string location, string operationId, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -22323,11 +17954,10 @@ public partial class DeviceRegistry var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + global::System.Uri.EscapeDataString(subscriptionId) - + "/resourceGroups/" - + global::System.Uri.EscapeDataString(resourceGroupName) - + "/providers/Microsoft.DeviceRegistry/namespaces/" - + global::System.Uri.EscapeDataString(namespaceName) - + "/credentials/default/policies" + + "/providers/Microsoft.DeviceRegistry/locations/" + + global::System.Uri.EscapeDataString(location) + + "/operationStatuses/" + + global::System.Uri.EscapeDataString(operationId) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -22341,21 +17971,19 @@ public partial class DeviceRegistry await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - return await this.PoliciesListByResourceGroupWithResult_Call (request, eventListener,sender); + return await this.OperationStatusGetWithResult_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.DeviceRegistry.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 PoliciesListByResourceGroupWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task OperationStatusGetWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -22374,7 +18002,7 @@ public partial class DeviceRegistry case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.PolicyListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode.Parse(body.Result)) ); + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.OperationStatusResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode.Parse(body.Result)) ); return await _result; } default: @@ -22407,7 +18035,7 @@ public partial class DeviceRegistry } } - /// 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 @@ -22417,7 +18045,7 @@ public partial class DeviceRegistry /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task PoliciesListByResourceGroup_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.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task OperationStatusGet_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.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -22436,7 +18064,7 @@ public partial class DeviceRegistry case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.PolicyListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.OperationStatusResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: @@ -22458,63 +18086,47 @@ public partial class DeviceRegistry } /// - /// 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 value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of the namespace. + /// The name of the Azure region. + /// The ID of an ongoing async 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 PoliciesListByResourceGroup_Validate(string subscriptionId, string resourceGroupName, string namespaceName, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task OperationStatusGet_Validate(string subscriptionId, string location, string operationId, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); - await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); - await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); - await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertNotNull(nameof(namespaceName),namespaceName); - await eventListener.AssertMinimumLength(nameof(namespaceName),namespaceName,3); - await eventListener.AssertMaximumLength(nameof(namespaceName),namespaceName,64); - await eventListener.AssertRegEx(nameof(namespaceName), namespaceName, @"^[a-z0-9][a-z0-9-]*[a-z0-9]$"); + await eventListener.AssertNotNull(nameof(location),location); + await eventListener.AssertMinimumLength(nameof(location),location,1); + await eventListener.AssertNotNull(nameof(operationId),operationId); + await eventListener.AssertMinimumLength(nameof(operationId),operationId,1); } } - /// update a Policy - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of the namespace. - /// The name of the Policy tracked resource. - /// The resource properties to be updated. + /// List the operations for the provider /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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 PoliciesUpdate(string subscriptionId, string resourceGroupName, string namespaceName, string policyName, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyUpdate body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeUpdate) + 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.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // 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.DeviceRegistry/namespaces/" - + global::System.Uri.EscapeDataString(namespaceName) - + "/credentials/default/policies/" - + global::System.Uri.EscapeDataString(policyName) + "/providers/Microsoft.DeviceRegistry/operations" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -22523,60 +18135,43 @@ public partial class DeviceRegistry // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Method.Patch, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Method.Get, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.PoliciesUpdate_Call (request, onOk,onDefault,eventListener,sender); + await this.OperationsList_Call (request, onOk,onDefault,eventListener,sender); } } - /// update a Policy + /// List the operations for the provider /// - /// The resource properties to be updated. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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 PoliciesUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyUpdate body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeUpdate) + 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.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.DeviceRegistry/namespaces/(?[^/]+)/credentials/default/policies/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/providers/Microsoft.DeviceRegistry/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.DeviceRegistry/namespaces/{namespaceName}/credentials/default/policies/{policyName}'"); + throw new global::System.Exception("Invalid identity for URI '/providers/Microsoft.DeviceRegistry/operations'"); } // replace URI parameters with values from identity - var subscriptionId = _match.Groups["subscriptionId"].Value; - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var namespaceName = _match.Groups["namespaceName"].Value; - var policyName = _match.Groups["policyName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/subscriptions/" - + subscriptionId - + "/resourceGroups/" - + resourceGroupName - + "/providers/Microsoft.DeviceRegistry/namespaces/" - + namespaceName - + "/credentials/default/policies/" - + policyName + "/providers/Microsoft.DeviceRegistry/operations" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -22585,158 +18180,41 @@ public partial class DeviceRegistry // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Method.Patch, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Method.Get, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.PoliciesUpdate_Call (request, onOk,onDefault,eventListener,sender); + await this.OperationsList_Call (request, onOk,onDefault,eventListener,sender); } } - /// update a Policy + /// List the operations for the provider /// - /// The resource properties to be updated. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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 PoliciesUpdateViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyUpdate body, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeUpdate) + public async global::System.Threading.Tasks.Task OperationsListViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.DeviceRegistry/namespaces/(?[^/]+)/credentials/default/policies/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/providers/Microsoft.DeviceRegistry/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.DeviceRegistry/namespaces/{namespaceName}/credentials/default/policies/{policyName}'"); - } - - // replace URI parameters with values from identity - var subscriptionId = _match.Groups["subscriptionId"].Value; - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var namespaceName = _match.Groups["namespaceName"].Value; - var policyName = _match.Groups["policyName"].Value; - // construct URL - var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/subscriptions/" - + subscriptionId - + "/resourceGroups/" - + resourceGroupName - + "/providers/Microsoft.DeviceRegistry/namespaces/" - + namespaceName - + "/credentials/default/policies/" - + policyName - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.Method.Patch, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } - // make the call - return await this.PoliciesUpdateWithResult_Call (request, eventListener,sender); - } - } - - /// update a Policy - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of the namespace. - /// The name of the Policy tracked resource. - /// Json string supplied to the PoliciesUpdate 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.DeviceRegistry.Runtime.ISendAsync pipeline to use to make the request. - /// - /// A that will be complete when handling of the response is completed. - /// - public async global::System.Threading.Tasks.Task PoliciesUpdateViaJsonString(string subscriptionId, string resourceGroupName, string namespaceName, string policyName, 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.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) - { - var apiVersion = @"2025-11-01-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.DeviceRegistry/namespaces/" - + global::System.Uri.EscapeDataString(namespaceName) - + "/credentials/default/policies/" - + global::System.Uri.EscapeDataString(policyName) - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.Method.Patch, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.PoliciesUpdate_Call (request, onOk,onDefault,eventListener,sender); - } - } - - /// update a Policy - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of the namespace. - /// The name of the Policy tracked resource. - /// Json string supplied to the PoliciesUpdate operation - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync pipeline to use to make the request. - /// - /// A - /// that will be complete when handling of the response is completed. - /// - public async global::System.Threading.Tasks.Task PoliciesUpdateViaJsonStringWithResult(string subscriptionId, string resourceGroupName, string namespaceName, string policyName, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) - { - var apiVersion = @"2025-11-01-preview"; - // Constant Parameters - using( NoSynchronizationContext ) - { + { + throw new global::System.Exception("Invalid identity for URI '/providers/Microsoft.DeviceRegistry/operations'"); + } + + // replace URI parameters with values from identity // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/subscriptions/" - + global::System.Uri.EscapeDataString(subscriptionId) - + "/resourceGroups/" - + global::System.Uri.EscapeDataString(resourceGroupName) - + "/providers/Microsoft.DeviceRegistry/namespaces/" - + global::System.Uri.EscapeDataString(namespaceName) - + "/credentials/default/policies/" - + global::System.Uri.EscapeDataString(policyName) + "/providers/Microsoft.DeviceRegistry/operations" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -22745,48 +18223,31 @@ public partial class DeviceRegistry // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Method.Patch, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Method.Get, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - return await this.PoliciesUpdateWithResult_Call (request, eventListener,sender); + return await this.OperationsListWithResult_Call (request, eventListener,sender); } } - /// update a Policy - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of the namespace. - /// The name of the Policy tracked resource. - /// The resource properties to be updated. + /// List the operations for the provider /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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 PoliciesUpdateWithResult(string subscriptionId, string resourceGroupName, string namespaceName, string policyName, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyUpdate body, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeUpdate) + public async global::System.Threading.Tasks.Task OperationsListWithResult(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // 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.DeviceRegistry/namespaces/" - + global::System.Uri.EscapeDataString(namespaceName) - + "/credentials/default/policies/" - + global::System.Uri.EscapeDataString(policyName) + "/providers/Microsoft.DeviceRegistry/operations" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -22795,131 +18256,34 @@ public partial class DeviceRegistry // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Method.Patch, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Method.Get, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - return await this.PoliciesUpdateWithResult_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.DeviceRegistry.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 PoliciesUpdateWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task OperationsListWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { global::System.Net.Http.HttpResponseMessage _response = null; try { - // this operation supports x-ms-long-running-operation - var _originalUri = request.RequestUri.AbsoluteUri; var sendTask = sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return null; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - // declared final-state-via: location - var _finalUri = _response.GetFirstHeader(@"Location"); - var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - var location = _response.GetFirstHeader(@"Location"); - var operationLocation = _response.GetFirstHeader(@"Operation-Location"); - while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) - { - // delay before making the next polling request - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - break; - } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } var _contentType = _response.Content.Headers.ContentType?.MediaType; @@ -22928,7 +18292,7 @@ public partial class DeviceRegistry case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.Policy.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode.Parse(body.Result)) ); + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.OperationListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode.Parse(body.Result)) ); return await _result; } default: @@ -22961,7 +18325,7 @@ public partial class DeviceRegistry } } - /// 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 @@ -22971,110 +18335,17 @@ public partial class DeviceRegistry /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task PoliciesUpdate_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.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { global::System.Net.Http.HttpResponseMessage _response = null; try { - // this operation supports x-ms-long-running-operation - var _originalUri = request.RequestUri.AbsoluteUri; var sendTask = sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // 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.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - break; - } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; @@ -23083,7 +18354,7 @@ public partial class DeviceRegistry case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.Policy.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.OperationListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: @@ -23105,37 +18376,18 @@ public partial class DeviceRegistry } /// - /// 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 value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of the namespace. - /// The name of the Policy tracked resource. - /// The resource properties to be updated. /// 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 PoliciesUpdate_Validate(string subscriptionId, string resourceGroupName, string namespaceName, string policyName, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyUpdate body, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task OperationsList_Validate(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); - await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); - await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); - await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); - await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertNotNull(nameof(namespaceName),namespaceName); - await eventListener.AssertMinimumLength(nameof(namespaceName),namespaceName,3); - await eventListener.AssertMaximumLength(nameof(namespaceName),namespaceName,64); - await eventListener.AssertRegEx(nameof(namespaceName), namespaceName, @"^[a-z0-9][a-z0-9-]*[a-z0-9]$"); - await eventListener.AssertNotNull(nameof(policyName),policyName); - await eventListener.AssertMinimumLength(nameof(policyName),policyName,3); - await eventListener.AssertMaximumLength(nameof(policyName),policyName,63); - await eventListener.AssertRegEx(nameof(policyName), policyName, @"^[0-9a-zA-Z][a-zA-Z0-9-]*$"); - await eventListener.AssertNotNull(nameof(body), body); - await eventListener.AssertObjectIsValid(nameof(body), body); + } } @@ -23155,7 +18407,7 @@ public partial class DeviceRegistry /// public async global::System.Threading.Tasks.Task SchemaRegistriesCreateOrReplace(string subscriptionId, string resourceGroupName, string schemaRegistryName, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ISchemaRegistry body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -23202,7 +18454,7 @@ public partial class DeviceRegistry /// public async global::System.Threading.Tasks.Task SchemaRegistriesCreateOrReplaceViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ISchemaRegistry body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -23259,7 +18511,7 @@ public partial class DeviceRegistry /// public async global::System.Threading.Tasks.Task SchemaRegistriesCreateOrReplaceViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ISchemaRegistry body, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -23319,7 +18571,7 @@ public partial class DeviceRegistry /// public async global::System.Threading.Tasks.Task SchemaRegistriesCreateOrReplaceViaJsonString(string subscriptionId, string resourceGroupName, string schemaRegistryName, 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.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -23365,7 +18617,7 @@ public partial class DeviceRegistry /// public async global::System.Threading.Tasks.Task SchemaRegistriesCreateOrReplaceViaJsonStringWithResult(string subscriptionId, string resourceGroupName, string schemaRegistryName, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -23412,7 +18664,7 @@ public partial class DeviceRegistry /// public async global::System.Threading.Tasks.Task SchemaRegistriesCreateOrReplaceWithResult(string subscriptionId, string resourceGroupName, string schemaRegistryName, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ISchemaRegistry body, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -23786,7 +19038,7 @@ public partial class DeviceRegistry /// public async global::System.Threading.Tasks.Task SchemaRegistriesDelete(string subscriptionId, string resourceGroupName, string schemaRegistryName, global::System.Func onNoContent, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -23828,7 +19080,7 @@ public partial class DeviceRegistry /// public async global::System.Threading.Tasks.Task SchemaRegistriesDeleteViaIdentity(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.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -24060,7 +19312,7 @@ public partial class DeviceRegistry /// public async global::System.Threading.Tasks.Task SchemaRegistriesGet(string subscriptionId, string resourceGroupName, string schemaRegistryName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -24101,7 +19353,7 @@ public partial class DeviceRegistry /// public async global::System.Threading.Tasks.Task SchemaRegistriesGetViaIdentity(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.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -24152,7 +19404,7 @@ public partial class DeviceRegistry /// public async global::System.Threading.Tasks.Task SchemaRegistriesGetViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -24205,7 +19457,7 @@ public partial class DeviceRegistry /// public async global::System.Threading.Tasks.Task SchemaRegistriesGetWithResult(string subscriptionId, string resourceGroupName, string schemaRegistryName, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -24384,7 +19636,7 @@ public partial class DeviceRegistry /// public async global::System.Threading.Tasks.Task SchemaRegistriesListByResourceGroup(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.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -24424,7 +19676,7 @@ public partial class DeviceRegistry /// public async global::System.Threading.Tasks.Task SchemaRegistriesListByResourceGroupViaIdentity(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.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -24473,7 +19725,7 @@ public partial class DeviceRegistry /// public async global::System.Threading.Tasks.Task SchemaRegistriesListByResourceGroupViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -24523,7 +19775,7 @@ public partial class DeviceRegistry /// public async global::System.Threading.Tasks.Task SchemaRegistriesListByResourceGroupWithResult(string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -24699,7 +19951,7 @@ public partial class DeviceRegistry /// public async global::System.Threading.Tasks.Task SchemaRegistriesListBySubscription(string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -24737,7 +19989,7 @@ public partial class DeviceRegistry /// public async global::System.Threading.Tasks.Task SchemaRegistriesListBySubscriptionViaIdentity(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.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -24783,7 +20035,7 @@ public partial class DeviceRegistry /// public async global::System.Threading.Tasks.Task SchemaRegistriesListBySubscriptionViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -24829,7 +20081,7 @@ public partial class DeviceRegistry /// public async global::System.Threading.Tasks.Task SchemaRegistriesListBySubscriptionWithResult(string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -25001,7 +20253,7 @@ public partial class DeviceRegistry /// public async global::System.Threading.Tasks.Task SchemaRegistriesUpdate(string subscriptionId, string resourceGroupName, string schemaRegistryName, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ISchemaRegistryUpdate body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -25048,7 +20300,7 @@ public partial class DeviceRegistry /// public async global::System.Threading.Tasks.Task SchemaRegistriesUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ISchemaRegistryUpdate body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -25105,7 +20357,7 @@ public partial class DeviceRegistry /// public async global::System.Threading.Tasks.Task SchemaRegistriesUpdateViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ISchemaRegistryUpdate body, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -25165,7 +20417,7 @@ public partial class DeviceRegistry /// public async global::System.Threading.Tasks.Task SchemaRegistriesUpdateViaJsonString(string subscriptionId, string resourceGroupName, string schemaRegistryName, 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.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -25211,7 +20463,7 @@ public partial class DeviceRegistry /// public async global::System.Threading.Tasks.Task SchemaRegistriesUpdateViaJsonStringWithResult(string subscriptionId, string resourceGroupName, string schemaRegistryName, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -25258,7 +20510,7 @@ public partial class DeviceRegistry /// public async global::System.Threading.Tasks.Task SchemaRegistriesUpdateWithResult(string subscriptionId, string resourceGroupName, string schemaRegistryName, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ISchemaRegistryUpdate body, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -25636,7 +20888,7 @@ public partial class DeviceRegistry /// public async global::System.Threading.Tasks.Task SchemaVersionsCreateOrReplace(string subscriptionId, string resourceGroupName, string schemaRegistryName, string schemaName, string schemaVersionName, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ISchemaVersion 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.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -25688,7 +20940,7 @@ public partial class DeviceRegistry /// public async global::System.Threading.Tasks.Task SchemaVersionsCreateOrReplaceViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ISchemaVersion 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.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -25751,7 +21003,7 @@ public partial class DeviceRegistry /// public async global::System.Threading.Tasks.Task SchemaVersionsCreateOrReplaceViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ISchemaVersion body, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -25820,7 +21072,7 @@ public partial class DeviceRegistry /// public async global::System.Threading.Tasks.Task SchemaVersionsCreateOrReplaceViaJsonString(string subscriptionId, string resourceGroupName, string schemaRegistryName, string schemaName, string schemaVersionName, 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.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -25872,7 +21124,7 @@ public partial class DeviceRegistry /// public async global::System.Threading.Tasks.Task SchemaVersionsCreateOrReplaceViaJsonStringWithResult(string subscriptionId, string resourceGroupName, string schemaRegistryName, string schemaName, string schemaVersionName, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -25925,7 +21177,7 @@ public partial class DeviceRegistry /// public async global::System.Threading.Tasks.Task SchemaVersionsCreateOrReplaceWithResult(string subscriptionId, string resourceGroupName, string schemaRegistryName, string schemaName, string schemaVersionName, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ISchemaVersion body, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -26144,7 +21396,7 @@ public partial class DeviceRegistry /// public async global::System.Threading.Tasks.Task SchemaVersionsDelete(string subscriptionId, string resourceGroupName, string schemaRegistryName, string schemaName, string schemaVersionName, global::System.Func onNoContent, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -26190,7 +21442,7 @@ public partial class DeviceRegistry /// public async global::System.Threading.Tasks.Task SchemaVersionsDeleteViaIdentity(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.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -26440,7 +21692,7 @@ public partial class DeviceRegistry /// public async global::System.Threading.Tasks.Task SchemaVersionsGet(string subscriptionId, string resourceGroupName, string schemaRegistryName, string schemaName, string schemaVersionName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -26485,7 +21737,7 @@ public partial class DeviceRegistry /// public async global::System.Threading.Tasks.Task SchemaVersionsGetViaIdentity(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.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -26542,7 +21794,7 @@ public partial class DeviceRegistry /// public async global::System.Threading.Tasks.Task SchemaVersionsGetViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -26603,7 +21855,7 @@ public partial class DeviceRegistry /// public async global::System.Threading.Tasks.Task SchemaVersionsGetWithResult(string subscriptionId, string resourceGroupName, string schemaRegistryName, string schemaName, string schemaVersionName, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -26798,7 +22050,7 @@ public partial class DeviceRegistry /// public async global::System.Threading.Tasks.Task SchemaVersionsListBySchema(string subscriptionId, string resourceGroupName, string schemaRegistryName, string schemaName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -26842,7 +22094,7 @@ public partial class DeviceRegistry /// public async global::System.Threading.Tasks.Task SchemaVersionsListBySchemaViaIdentity(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.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -26897,7 +22149,7 @@ public partial class DeviceRegistry /// public async global::System.Threading.Tasks.Task SchemaVersionsListBySchemaViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -26955,7 +22207,7 @@ public partial class DeviceRegistry /// public async global::System.Threading.Tasks.Task SchemaVersionsListBySchemaWithResult(string subscriptionId, string resourceGroupName, string schemaRegistryName, string schemaName, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -27149,7 +22401,7 @@ public partial class DeviceRegistry /// public async global::System.Threading.Tasks.Task SchemasCreateOrReplace(string subscriptionId, string resourceGroupName, string schemaRegistryName, string schemaName, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ISchema 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.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -27199,7 +22451,7 @@ public partial class DeviceRegistry /// public async global::System.Threading.Tasks.Task SchemasCreateOrReplaceViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ISchema 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.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -27259,7 +22511,7 @@ public partial class DeviceRegistry /// public async global::System.Threading.Tasks.Task SchemasCreateOrReplaceViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ISchema body, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -27324,7 +22576,7 @@ public partial class DeviceRegistry /// public async global::System.Threading.Tasks.Task SchemasCreateOrReplaceViaJsonString(string subscriptionId, string resourceGroupName, string schemaRegistryName, string schemaName, 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.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -27373,7 +22625,7 @@ public partial class DeviceRegistry /// public async global::System.Threading.Tasks.Task SchemasCreateOrReplaceViaJsonStringWithResult(string subscriptionId, string resourceGroupName, string schemaRegistryName, string schemaName, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -27423,7 +22675,7 @@ public partial class DeviceRegistry /// public async global::System.Threading.Tasks.Task SchemasCreateOrReplaceWithResult(string subscriptionId, string resourceGroupName, string schemaRegistryName, string schemaName, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ISchema body, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -27632,7 +22884,7 @@ public partial class DeviceRegistry /// public async global::System.Threading.Tasks.Task SchemasDelete(string subscriptionId, string resourceGroupName, string schemaRegistryName, string schemaName, global::System.Func onNoContent, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -27676,7 +22928,7 @@ public partial class DeviceRegistry /// public async global::System.Threading.Tasks.Task SchemasDeleteViaIdentity(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.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -27917,7 +23169,7 @@ public partial class DeviceRegistry /// public async global::System.Threading.Tasks.Task SchemasGet(string subscriptionId, string resourceGroupName, string schemaRegistryName, string schemaName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -27960,7 +23212,7 @@ public partial class DeviceRegistry /// public async global::System.Threading.Tasks.Task SchemasGetViaIdentity(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.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -28014,7 +23266,7 @@ public partial class DeviceRegistry /// public async global::System.Threading.Tasks.Task SchemasGetViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -28071,7 +23323,7 @@ public partial class DeviceRegistry /// public async global::System.Threading.Tasks.Task SchemasGetWithResult(string subscriptionId, string resourceGroupName, string schemaRegistryName, string schemaName, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -28258,7 +23510,7 @@ public partial class DeviceRegistry /// public async global::System.Threading.Tasks.Task SchemasListBySchemaRegistry(string subscriptionId, string resourceGroupName, string schemaRegistryName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -28300,7 +23552,7 @@ public partial class DeviceRegistry /// public async global::System.Threading.Tasks.Task SchemasListBySchemaRegistryViaIdentity(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.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -28352,7 +23604,7 @@ public partial class DeviceRegistry /// public async global::System.Threading.Tasks.Task SchemasListBySchemaRegistryViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -28406,7 +23658,7 @@ public partial class DeviceRegistry /// public async global::System.Threading.Tasks.Task SchemasListBySchemaRegistryWithResult(string subscriptionId, string resourceGroupName, string schemaRegistryName, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.ISendAsync sender) { - var apiVersion = @"2025-11-01-preview"; + var apiVersion = @"2025-10-01"; // Constant Parameters using( NoSynchronizationContext ) { diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/CertificateAuthorityConfiguration.PowerShell.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/CertificateAuthorityConfiguration.PowerShell.cs deleted file mode 100644 index bfbe3744b194..000000000000 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/CertificateAuthorityConfiguration.PowerShell.cs +++ /dev/null @@ -1,192 +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.DeviceRegistry.Models -{ - using Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.PowerShell; - - /// The configuration to set up an ICA. - [System.ComponentModel.TypeConverter(typeof(CertificateAuthorityConfigurationTypeConverter))] - public partial class CertificateAuthorityConfiguration - { - - /// - /// 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 CertificateAuthorityConfiguration(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("KeyType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICertificateAuthorityConfigurationInternal)this).KeyType = (string) content.GetValueForProperty("KeyType",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICertificateAuthorityConfigurationInternal)this).KeyType, global::System.Convert.ToString); - } - if (content.Contains("Subject")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICertificateAuthorityConfigurationInternal)this).Subject = (string) content.GetValueForProperty("Subject",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICertificateAuthorityConfigurationInternal)this).Subject, global::System.Convert.ToString); - } - if (content.Contains("ValidityNotBefore")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICertificateAuthorityConfigurationInternal)this).ValidityNotBefore = (global::System.DateTime?) content.GetValueForProperty("ValidityNotBefore",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICertificateAuthorityConfigurationInternal)this).ValidityNotBefore, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("ValidityNotAfter")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICertificateAuthorityConfigurationInternal)this).ValidityNotAfter = (global::System.DateTime?) content.GetValueForProperty("ValidityNotAfter",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICertificateAuthorityConfigurationInternal)this).ValidityNotAfter, (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 CertificateAuthorityConfiguration(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("KeyType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICertificateAuthorityConfigurationInternal)this).KeyType = (string) content.GetValueForProperty("KeyType",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICertificateAuthorityConfigurationInternal)this).KeyType, global::System.Convert.ToString); - } - if (content.Contains("Subject")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICertificateAuthorityConfigurationInternal)this).Subject = (string) content.GetValueForProperty("Subject",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICertificateAuthorityConfigurationInternal)this).Subject, global::System.Convert.ToString); - } - if (content.Contains("ValidityNotBefore")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICertificateAuthorityConfigurationInternal)this).ValidityNotBefore = (global::System.DateTime?) content.GetValueForProperty("ValidityNotBefore",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICertificateAuthorityConfigurationInternal)this).ValidityNotBefore, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("ValidityNotAfter")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICertificateAuthorityConfigurationInternal)this).ValidityNotAfter = (global::System.DateTime?) content.GetValueForProperty("ValidityNotAfter",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICertificateAuthorityConfigurationInternal)this).ValidityNotAfter, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - AfterDeserializePSObject(content); - } - - /// - /// Deserializes a into an instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICertificateAuthorityConfiguration DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new CertificateAuthorityConfiguration(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.DeviceRegistry.Models.ICertificateAuthorityConfiguration DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new CertificateAuthorityConfiguration(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.DeviceRegistry.Models.ICertificateAuthorityConfiguration FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.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 configuration to set up an ICA. - [System.ComponentModel.TypeConverter(typeof(CertificateAuthorityConfigurationTypeConverter))] - public partial interface ICertificateAuthorityConfiguration - - { - - } -} \ No newline at end of file diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/CertificateAuthorityConfiguration.TypeConverter.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/CertificateAuthorityConfiguration.TypeConverter.cs deleted file mode 100644 index 34e80617d3a5..000000000000 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/CertificateAuthorityConfiguration.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.DeviceRegistry.Models -{ - using Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.PowerShell; - - /// - /// A PowerShell PSTypeConverter to support converting to an instance of - /// - public partial class CertificateAuthorityConfigurationTypeConverter : 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.DeviceRegistry.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Models.ICertificateAuthorityConfiguration ConvertFrom(dynamic sourceValue) - { - if (null == sourceValue) - { - return null; - } - global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICertificateAuthorityConfiguration).IsAssignableFrom(type)) - { - return sourceValue; - } - try - { - return CertificateAuthorityConfiguration.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; - } - catch - { - // Unable to use JSON pattern - } - if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) - { - return CertificateAuthorityConfiguration.DeserializeFromPSObject(sourceValue); - } - if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) - { - return CertificateAuthorityConfiguration.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/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/CertificateAuthorityConfiguration.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/CertificateAuthorityConfiguration.cs deleted file mode 100644 index bdaff3c5f6f1..000000000000 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/CertificateAuthorityConfiguration.cs +++ /dev/null @@ -1,138 +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.DeviceRegistry.Models -{ - using static Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Extensions; - - /// The configuration to set up an ICA. - public partial class CertificateAuthorityConfiguration : - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICertificateAuthorityConfiguration, - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICertificateAuthorityConfigurationInternal - { - - /// Backing field for property. - private string _keyType= @"ECC"; - - /// Crypto type: ECC. - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Origin(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.PropertyOrigin.Owned)] - public string KeyType { get => this._keyType; } - - /// Internal Acessors for KeyType - string Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICertificateAuthorityConfigurationInternal.KeyType { get => this._keyType; set { {_keyType = value;} } } - - /// Internal Acessors for Subject - string Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICertificateAuthorityConfigurationInternal.Subject { get => this._subject; set { {_subject = value;} } } - - /// Internal Acessors for ValidityNotAfter - global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICertificateAuthorityConfigurationInternal.ValidityNotAfter { get => this._validityNotAfter; set { {_validityNotAfter = value;} } } - - /// Internal Acessors for ValidityNotBefore - global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICertificateAuthorityConfigurationInternal.ValidityNotBefore { get => this._validityNotBefore; set { {_validityNotBefore = value;} } } - - /// Backing field for property. - private string _subject; - - /// Certificate subject. - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Origin(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.PropertyOrigin.Owned)] - public string Subject { get => this._subject; } - - /// Backing field for property. - private global::System.DateTime? _validityNotAfter; - - /// - /// Certificate is valid not after this date. Format ISO8601. Generated based on validity period. - /// - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Origin(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.PropertyOrigin.Owned)] - public global::System.DateTime? ValidityNotAfter { get => this._validityNotAfter; } - - /// Backing field for property. - private global::System.DateTime? _validityNotBefore; - - /// - /// Certificate is valid not before this date. Format ISO8601. Generated based on on validity period. - /// - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Origin(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.PropertyOrigin.Owned)] - public global::System.DateTime? ValidityNotBefore { get => this._validityNotBefore; } - - /// Creates an new instance. - public CertificateAuthorityConfiguration() - { - - } - } - /// The configuration to set up an ICA. - public partial interface ICertificateAuthorityConfiguration : - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IJsonSerializable - { - /// Crypto type: ECC. - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Info( - Required = false, - ReadOnly = true, - Read = true, - Create = true, - Update = false, - Description = @"Crypto type: ECC.", - SerializedName = @"keyType", - PossibleTypes = new [] { typeof(string) })] - string KeyType { get; } - /// Certificate subject. - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Info( - Required = false, - ReadOnly = true, - Read = true, - Create = false, - Update = false, - Description = @"Certificate subject.", - SerializedName = @"subject", - PossibleTypes = new [] { typeof(string) })] - string Subject { get; } - /// - /// Certificate is valid not after this date. Format ISO8601. Generated based on validity period. - /// - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Info( - Required = false, - ReadOnly = true, - Read = true, - Create = false, - Update = false, - Description = @"Certificate is valid not after this date. Format ISO8601. Generated based on validity period.", - SerializedName = @"validityNotAfter", - PossibleTypes = new [] { typeof(global::System.DateTime) })] - global::System.DateTime? ValidityNotAfter { get; } - /// - /// Certificate is valid not before this date. Format ISO8601. Generated based on on validity period. - /// - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Info( - Required = false, - ReadOnly = true, - Read = true, - Create = false, - Update = false, - Description = @"Certificate is valid not before this date. Format ISO8601. Generated based on on validity period.", - SerializedName = @"validityNotBefore", - PossibleTypes = new [] { typeof(global::System.DateTime) })] - global::System.DateTime? ValidityNotBefore { get; } - - } - /// The configuration to set up an ICA. - internal partial interface ICertificateAuthorityConfigurationInternal - - { - /// Crypto type: ECC. - string KeyType { get; set; } - /// Certificate subject. - string Subject { get; set; } - /// - /// Certificate is valid not after this date. Format ISO8601. Generated based on validity period. - /// - global::System.DateTime? ValidityNotAfter { get; set; } - /// - /// Certificate is valid not before this date. Format ISO8601. Generated based on on validity period. - /// - global::System.DateTime? ValidityNotBefore { get; set; } - - } -} \ No newline at end of file diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/CertificateAuthorityConfiguration.json.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/CertificateAuthorityConfiguration.json.cs deleted file mode 100644 index eeb72ca1de6a..000000000000 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/CertificateAuthorityConfiguration.json.cs +++ /dev/null @@ -1,126 +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.DeviceRegistry.Models -{ - using static Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Extensions; - - /// The configuration to set up an ICA. - public partial class CertificateAuthorityConfiguration - { - - /// - /// 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.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.Runtime.Json.JsonObject container, ref bool returnNow); - - /// - /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonObject into a new instance of . - /// - /// A Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonObject instance to deserialize from. - internal CertificateAuthorityConfiguration(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonObject json) - { - bool returnNow = false; - BeforeFromJson(json, ref returnNow); - if (returnNow) - { - return; - } - {_keyType = If( json?.PropertyT("keyType"), out var __jsonKeyType) ? (string)__jsonKeyType : (string)_keyType;} - {_subject = If( json?.PropertyT("subject"), out var __jsonSubject) ? (string)__jsonSubject : (string)_subject;} - {_validityNotBefore = If( json?.PropertyT("validityNotBefore"), out var __jsonValidityNotBefore) ? global::System.DateTime.TryParse((string)__jsonValidityNotBefore, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonValidityNotBeforeValue) ? __jsonValidityNotBeforeValue : _validityNotBefore : _validityNotBefore;} - {_validityNotAfter = If( json?.PropertyT("validityNotAfter"), out var __jsonValidityNotAfter) ? global::System.DateTime.TryParse((string)__jsonValidityNotAfter, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonValidityNotAfterValue) ? __jsonValidityNotAfterValue : _validityNotAfter : _validityNotAfter;} - AfterFromJson(json); - } - - /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICertificateAuthorityConfiguration. - /// - /// a to deserialize from. - /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICertificateAuthorityConfiguration. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICertificateAuthorityConfiguration FromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode node) - { - return node is Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonObject json ? new CertificateAuthorityConfiguration(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.DeviceRegistry.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode serializationMode) - { - container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonObject(); - - bool returnNow = false; - BeforeToJson(ref container, ref returnNow); - if (returnNow) - { - return container; - } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeRead)||serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeCreate)) - { - AddIf( null != (((object)this._keyType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonString(this._keyType.ToString()) : null, "keyType" ,container.Add ); - } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeRead)) - { - AddIf( null != (((object)this._subject)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonString(this._subject.ToString()) : null, "subject" ,container.Add ); - } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeRead)) - { - AddIf( null != this._validityNotBefore ? (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonString(this._validityNotBefore?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "validityNotBefore" ,container.Add ); - } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeRead)) - { - AddIf( null != this._validityNotAfter ? (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonString(this._validityNotAfter?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "validityNotAfter" ,container.Add ); - } - AfterToJson(ref container); - return container; - } - } -} \ No newline at end of file diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/CertificateConfiguration.PowerShell.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/CertificateConfiguration.PowerShell.cs deleted file mode 100644 index 66c5d356e64e..000000000000 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/CertificateConfiguration.PowerShell.cs +++ /dev/null @@ -1,212 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models -{ - using Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.PowerShell; - - /// The certificate configuration. - [System.ComponentModel.TypeConverter(typeof(CertificateConfigurationTypeConverter))] - public partial class CertificateConfiguration - { - - /// - /// 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 CertificateConfiguration(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("CertificateAuthorityConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICertificateConfigurationInternal)this).CertificateAuthorityConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICertificateAuthorityConfiguration) content.GetValueForProperty("CertificateAuthorityConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICertificateConfigurationInternal)this).CertificateAuthorityConfiguration, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.CertificateAuthorityConfigurationTypeConverter.ConvertFrom); - } - if (content.Contains("LeafCertificateConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICertificateConfigurationInternal)this).LeafCertificateConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ILeafCertificateConfiguration) content.GetValueForProperty("LeafCertificateConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICertificateConfigurationInternal)this).LeafCertificateConfiguration, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.LeafCertificateConfigurationTypeConverter.ConvertFrom); - } - if (content.Contains("CertificateAuthorityConfigurationSubject")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICertificateConfigurationInternal)this).CertificateAuthorityConfigurationSubject = (string) content.GetValueForProperty("CertificateAuthorityConfigurationSubject",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICertificateConfigurationInternal)this).CertificateAuthorityConfigurationSubject, global::System.Convert.ToString); - } - if (content.Contains("CertificateAuthorityConfigurationKeyType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICertificateConfigurationInternal)this).CertificateAuthorityConfigurationKeyType = (string) content.GetValueForProperty("CertificateAuthorityConfigurationKeyType",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICertificateConfigurationInternal)this).CertificateAuthorityConfigurationKeyType, global::System.Convert.ToString); - } - if (content.Contains("CertificateAuthorityConfigurationValidityNotBefore")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICertificateConfigurationInternal)this).CertificateAuthorityConfigurationValidityNotBefore = (global::System.DateTime?) content.GetValueForProperty("CertificateAuthorityConfigurationValidityNotBefore",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICertificateConfigurationInternal)this).CertificateAuthorityConfigurationValidityNotBefore, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("CertificateAuthorityConfigurationValidityNotAfter")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICertificateConfigurationInternal)this).CertificateAuthorityConfigurationValidityNotAfter = (global::System.DateTime?) content.GetValueForProperty("CertificateAuthorityConfigurationValidityNotAfter",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICertificateConfigurationInternal)this).CertificateAuthorityConfigurationValidityNotAfter, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("LeafCertificateConfigurationValidityPeriodInDay")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICertificateConfigurationInternal)this).LeafCertificateConfigurationValidityPeriodInDay = (int) content.GetValueForProperty("LeafCertificateConfigurationValidityPeriodInDay",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICertificateConfigurationInternal)this).LeafCertificateConfigurationValidityPeriodInDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal CertificateConfiguration(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("CertificateAuthorityConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICertificateConfigurationInternal)this).CertificateAuthorityConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICertificateAuthorityConfiguration) content.GetValueForProperty("CertificateAuthorityConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICertificateConfigurationInternal)this).CertificateAuthorityConfiguration, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.CertificateAuthorityConfigurationTypeConverter.ConvertFrom); - } - if (content.Contains("LeafCertificateConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICertificateConfigurationInternal)this).LeafCertificateConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ILeafCertificateConfiguration) content.GetValueForProperty("LeafCertificateConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICertificateConfigurationInternal)this).LeafCertificateConfiguration, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.LeafCertificateConfigurationTypeConverter.ConvertFrom); - } - if (content.Contains("CertificateAuthorityConfigurationSubject")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICertificateConfigurationInternal)this).CertificateAuthorityConfigurationSubject = (string) content.GetValueForProperty("CertificateAuthorityConfigurationSubject",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICertificateConfigurationInternal)this).CertificateAuthorityConfigurationSubject, global::System.Convert.ToString); - } - if (content.Contains("CertificateAuthorityConfigurationKeyType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICertificateConfigurationInternal)this).CertificateAuthorityConfigurationKeyType = (string) content.GetValueForProperty("CertificateAuthorityConfigurationKeyType",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICertificateConfigurationInternal)this).CertificateAuthorityConfigurationKeyType, global::System.Convert.ToString); - } - if (content.Contains("CertificateAuthorityConfigurationValidityNotBefore")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICertificateConfigurationInternal)this).CertificateAuthorityConfigurationValidityNotBefore = (global::System.DateTime?) content.GetValueForProperty("CertificateAuthorityConfigurationValidityNotBefore",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICertificateConfigurationInternal)this).CertificateAuthorityConfigurationValidityNotBefore, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("CertificateAuthorityConfigurationValidityNotAfter")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICertificateConfigurationInternal)this).CertificateAuthorityConfigurationValidityNotAfter = (global::System.DateTime?) content.GetValueForProperty("CertificateAuthorityConfigurationValidityNotAfter",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICertificateConfigurationInternal)this).CertificateAuthorityConfigurationValidityNotAfter, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("LeafCertificateConfigurationValidityPeriodInDay")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICertificateConfigurationInternal)this).LeafCertificateConfigurationValidityPeriodInDay = (int) content.GetValueForProperty("LeafCertificateConfigurationValidityPeriodInDay",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICertificateConfigurationInternal)this).LeafCertificateConfigurationValidityPeriodInDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); - } - AfterDeserializePSObject(content); - } - - /// - /// Deserializes a into an instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICertificateConfiguration DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new CertificateConfiguration(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.DeviceRegistry.Models.ICertificateConfiguration DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new CertificateConfiguration(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.DeviceRegistry.Models.ICertificateConfiguration FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.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 certificate configuration. - [System.ComponentModel.TypeConverter(typeof(CertificateConfigurationTypeConverter))] - public partial interface ICertificateConfiguration - - { - - } -} \ No newline at end of file diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/CertificateConfiguration.TypeConverter.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/CertificateConfiguration.TypeConverter.cs deleted file mode 100644 index 91bb9acc1b90..000000000000 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/CertificateConfiguration.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.DeviceRegistry.Models -{ - using Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.PowerShell; - - /// - /// A PowerShell PSTypeConverter to support converting to an instance of - /// - public partial class CertificateConfigurationTypeConverter : 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.DeviceRegistry.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Models.ICertificateConfiguration ConvertFrom(dynamic sourceValue) - { - if (null == sourceValue) - { - return null; - } - global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICertificateConfiguration).IsAssignableFrom(type)) - { - return sourceValue; - } - try - { - return CertificateConfiguration.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; - } - catch - { - // Unable to use JSON pattern - } - if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) - { - return CertificateConfiguration.DeserializeFromPSObject(sourceValue); - } - if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) - { - return CertificateConfiguration.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/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/CertificateConfiguration.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/CertificateConfiguration.cs deleted file mode 100644 index 604e72d2a895..000000000000 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/CertificateConfiguration.cs +++ /dev/null @@ -1,167 +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.DeviceRegistry.Models -{ - using static Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Extensions; - - /// The certificate configuration. - public partial class CertificateConfiguration : - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICertificateConfiguration, - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICertificateConfigurationInternal - { - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICertificateAuthorityConfiguration _certificateAuthorityConfiguration; - - /// The configuration to set up an ICA. - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Origin(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICertificateAuthorityConfiguration CertificateAuthorityConfiguration { get => (this._certificateAuthorityConfiguration = this._certificateAuthorityConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.CertificateAuthorityConfiguration()); set => this._certificateAuthorityConfiguration = value; } - - /// Crypto type: ECC. - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Origin(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.PropertyOrigin.Inlined)] - public string CertificateAuthorityConfigurationKeyType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICertificateAuthorityConfigurationInternal)CertificateAuthorityConfiguration).KeyType; } - - /// Certificate subject. - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Origin(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.PropertyOrigin.Inlined)] - public string CertificateAuthorityConfigurationSubject { get => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICertificateAuthorityConfigurationInternal)CertificateAuthorityConfiguration).Subject; } - - /// - /// Certificate is valid not after this date. Format ISO8601. Generated based on validity period. - /// - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Origin(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.PropertyOrigin.Inlined)] - public global::System.DateTime? CertificateAuthorityConfigurationValidityNotAfter { get => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICertificateAuthorityConfigurationInternal)CertificateAuthorityConfiguration).ValidityNotAfter; } - - /// - /// Certificate is valid not before this date. Format ISO8601. Generated based on on validity period. - /// - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Origin(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.PropertyOrigin.Inlined)] - public global::System.DateTime? CertificateAuthorityConfigurationValidityNotBefore { get => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICertificateAuthorityConfigurationInternal)CertificateAuthorityConfiguration).ValidityNotBefore; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ILeafCertificateConfiguration _leafCertificateConfiguration; - - /// The leaf certificate configuration. - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Origin(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ILeafCertificateConfiguration LeafCertificateConfiguration { get => (this._leafCertificateConfiguration = this._leafCertificateConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.LeafCertificateConfiguration()); set => this._leafCertificateConfiguration = value; } - - /// The validity period in days. - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Origin(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.PropertyOrigin.Inlined)] - public int LeafCertificateConfigurationValidityPeriodInDay { get => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ILeafCertificateConfigurationInternal)LeafCertificateConfiguration).ValidityPeriodInDay; set => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ILeafCertificateConfigurationInternal)LeafCertificateConfiguration).ValidityPeriodInDay = value ; } - - /// Internal Acessors for CertificateAuthorityConfiguration - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICertificateAuthorityConfiguration Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICertificateConfigurationInternal.CertificateAuthorityConfiguration { get => (this._certificateAuthorityConfiguration = this._certificateAuthorityConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.CertificateAuthorityConfiguration()); set { {_certificateAuthorityConfiguration = value;} } } - - /// Internal Acessors for CertificateAuthorityConfigurationKeyType - string Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICertificateConfigurationInternal.CertificateAuthorityConfigurationKeyType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICertificateAuthorityConfigurationInternal)CertificateAuthorityConfiguration).KeyType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICertificateAuthorityConfigurationInternal)CertificateAuthorityConfiguration).KeyType = value ?? null; } - - /// Internal Acessors for CertificateAuthorityConfigurationSubject - string Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICertificateConfigurationInternal.CertificateAuthorityConfigurationSubject { get => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICertificateAuthorityConfigurationInternal)CertificateAuthorityConfiguration).Subject; set => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICertificateAuthorityConfigurationInternal)CertificateAuthorityConfiguration).Subject = value ?? null; } - - /// Internal Acessors for CertificateAuthorityConfigurationValidityNotAfter - global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICertificateConfigurationInternal.CertificateAuthorityConfigurationValidityNotAfter { get => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICertificateAuthorityConfigurationInternal)CertificateAuthorityConfiguration).ValidityNotAfter; set => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICertificateAuthorityConfigurationInternal)CertificateAuthorityConfiguration).ValidityNotAfter = value ?? default(global::System.DateTime); } - - /// Internal Acessors for CertificateAuthorityConfigurationValidityNotBefore - global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICertificateConfigurationInternal.CertificateAuthorityConfigurationValidityNotBefore { get => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICertificateAuthorityConfigurationInternal)CertificateAuthorityConfiguration).ValidityNotBefore; set => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICertificateAuthorityConfigurationInternal)CertificateAuthorityConfiguration).ValidityNotBefore = value ?? default(global::System.DateTime); } - - /// Internal Acessors for LeafCertificateConfiguration - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ILeafCertificateConfiguration Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICertificateConfigurationInternal.LeafCertificateConfiguration { get => (this._leafCertificateConfiguration = this._leafCertificateConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.LeafCertificateConfiguration()); set { {_leafCertificateConfiguration = value;} } } - - /// Creates an new instance. - public CertificateConfiguration() - { - - } - } - /// The certificate configuration. - public partial interface ICertificateConfiguration : - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IJsonSerializable - { - /// Crypto type: ECC. - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Info( - Required = false, - ReadOnly = true, - Read = true, - Create = true, - Update = false, - Description = @"Crypto type: ECC.", - SerializedName = @"keyType", - PossibleTypes = new [] { typeof(string) })] - string CertificateAuthorityConfigurationKeyType { get; } - /// Certificate subject. - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Info( - Required = false, - ReadOnly = true, - Read = true, - Create = false, - Update = false, - Description = @"Certificate subject.", - SerializedName = @"subject", - PossibleTypes = new [] { typeof(string) })] - string CertificateAuthorityConfigurationSubject { get; } - /// - /// Certificate is valid not after this date. Format ISO8601. Generated based on validity period. - /// - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Info( - Required = false, - ReadOnly = true, - Read = true, - Create = false, - Update = false, - Description = @"Certificate is valid not after this date. Format ISO8601. Generated based on validity period.", - SerializedName = @"validityNotAfter", - PossibleTypes = new [] { typeof(global::System.DateTime) })] - global::System.DateTime? CertificateAuthorityConfigurationValidityNotAfter { get; } - /// - /// Certificate is valid not before this date. Format ISO8601. Generated based on on validity period. - /// - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Info( - Required = false, - ReadOnly = true, - Read = true, - Create = false, - Update = false, - Description = @"Certificate is valid not before this date. Format ISO8601. Generated based on on validity period.", - SerializedName = @"validityNotBefore", - PossibleTypes = new [] { typeof(global::System.DateTime) })] - global::System.DateTime? CertificateAuthorityConfigurationValidityNotBefore { get; } - /// The validity period in days. - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Info( - Required = true, - ReadOnly = false, - Read = true, - Create = true, - Update = true, - Description = @"The validity period in days.", - SerializedName = @"validityPeriodInDays", - PossibleTypes = new [] { typeof(int) })] - int LeafCertificateConfigurationValidityPeriodInDay { get; set; } - - } - /// The certificate configuration. - internal partial interface ICertificateConfigurationInternal - - { - /// The configuration to set up an ICA. - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICertificateAuthorityConfiguration CertificateAuthorityConfiguration { get; set; } - /// Crypto type: ECC. - string CertificateAuthorityConfigurationKeyType { get; set; } - /// Certificate subject. - string CertificateAuthorityConfigurationSubject { get; set; } - /// - /// Certificate is valid not after this date. Format ISO8601. Generated based on validity period. - /// - global::System.DateTime? CertificateAuthorityConfigurationValidityNotAfter { get; set; } - /// - /// Certificate is valid not before this date. Format ISO8601. Generated based on on validity period. - /// - global::System.DateTime? CertificateAuthorityConfigurationValidityNotBefore { get; set; } - /// The leaf certificate configuration. - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ILeafCertificateConfiguration LeafCertificateConfiguration { get; set; } - /// The validity period in days. - int LeafCertificateConfigurationValidityPeriodInDay { get; set; } - - } -} \ No newline at end of file diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/CertificateConfiguration.json.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/CertificateConfiguration.json.cs deleted file mode 100644 index efd892b2f514..000000000000 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/CertificateConfiguration.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.DeviceRegistry.Models -{ - using static Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Extensions; - - /// The certificate configuration. - public partial class CertificateConfiguration - { - - /// - /// 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.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.Runtime.Json.JsonObject container, ref bool returnNow); - - /// - /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonObject into a new instance of . - /// - /// A Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonObject instance to deserialize from. - internal CertificateConfiguration(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonObject json) - { - bool returnNow = false; - BeforeFromJson(json, ref returnNow); - if (returnNow) - { - return; - } - {_certificateAuthorityConfiguration = If( json?.PropertyT("certificateAuthorityConfiguration"), out var __jsonCertificateAuthorityConfiguration) ? Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.CertificateAuthorityConfiguration.FromJson(__jsonCertificateAuthorityConfiguration) : _certificateAuthorityConfiguration;} - {_leafCertificateConfiguration = If( json?.PropertyT("leafCertificateConfiguration"), out var __jsonLeafCertificateConfiguration) ? Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.LeafCertificateConfiguration.FromJson(__jsonLeafCertificateConfiguration) : _leafCertificateConfiguration;} - AfterFromJson(json); - } - - /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICertificateConfiguration. - /// - /// a to deserialize from. - /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICertificateConfiguration. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICertificateConfiguration FromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode node) - { - return node is Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonObject json ? new CertificateConfiguration(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.DeviceRegistry.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode serializationMode) - { - container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonObject(); - - bool returnNow = false; - BeforeToJson(ref container, ref returnNow); - if (returnNow) - { - return container; - } - AddIf( null != this._certificateAuthorityConfiguration ? (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode) this._certificateAuthorityConfiguration.ToJson(null,serializationMode) : null, "certificateAuthorityConfiguration" ,container.Add ); - AddIf( null != this._leafCertificateConfiguration ? (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode) this._leafCertificateConfiguration.ToJson(null,serializationMode) : null, "leafCertificateConfiguration" ,container.Add ); - AfterToJson(ref container); - return container; - } - } -} \ No newline at end of file diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/CertificateConfigurationUpdate.PowerShell.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/CertificateConfigurationUpdate.PowerShell.cs deleted file mode 100644 index 4484fb5b4dc0..000000000000 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/CertificateConfigurationUpdate.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.DeviceRegistry.Models -{ - using Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.PowerShell; - - /// The certificate configuration. - [System.ComponentModel.TypeConverter(typeof(CertificateConfigurationUpdateTypeConverter))] - public partial class CertificateConfigurationUpdate - { - - /// - /// 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 CertificateConfigurationUpdate(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("LeafCertificateConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICertificateConfigurationUpdateInternal)this).LeafCertificateConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ILeafCertificateConfigurationUpdate) content.GetValueForProperty("LeafCertificateConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICertificateConfigurationUpdateInternal)this).LeafCertificateConfiguration, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.LeafCertificateConfigurationUpdateTypeConverter.ConvertFrom); - } - if (content.Contains("CertificateAuthorityConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICertificateConfigurationUpdateInternal)this).CertificateAuthorityConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAny) content.GetValueForProperty("CertificateAuthorityConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICertificateConfigurationUpdateInternal)this).CertificateAuthorityConfiguration, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.AnyTypeConverter.ConvertFrom); - } - if (content.Contains("LeafCertificateConfigurationValidityPeriodInDay")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICertificateConfigurationUpdateInternal)this).LeafCertificateConfigurationValidityPeriodInDay = (int?) content.GetValueForProperty("LeafCertificateConfigurationValidityPeriodInDay",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICertificateConfigurationUpdateInternal)this).LeafCertificateConfigurationValidityPeriodInDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal CertificateConfigurationUpdate(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("LeafCertificateConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICertificateConfigurationUpdateInternal)this).LeafCertificateConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ILeafCertificateConfigurationUpdate) content.GetValueForProperty("LeafCertificateConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICertificateConfigurationUpdateInternal)this).LeafCertificateConfiguration, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.LeafCertificateConfigurationUpdateTypeConverter.ConvertFrom); - } - if (content.Contains("CertificateAuthorityConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICertificateConfigurationUpdateInternal)this).CertificateAuthorityConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAny) content.GetValueForProperty("CertificateAuthorityConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICertificateConfigurationUpdateInternal)this).CertificateAuthorityConfiguration, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.AnyTypeConverter.ConvertFrom); - } - if (content.Contains("LeafCertificateConfigurationValidityPeriodInDay")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICertificateConfigurationUpdateInternal)this).LeafCertificateConfigurationValidityPeriodInDay = (int?) content.GetValueForProperty("LeafCertificateConfigurationValidityPeriodInDay",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICertificateConfigurationUpdateInternal)this).LeafCertificateConfigurationValidityPeriodInDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); - } - AfterDeserializePSObject(content); - } - - /// - /// Deserializes a into an instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICertificateConfigurationUpdate DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new CertificateConfigurationUpdate(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.DeviceRegistry.Models.ICertificateConfigurationUpdate DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new CertificateConfigurationUpdate(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.DeviceRegistry.Models.ICertificateConfigurationUpdate FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.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 certificate configuration. - [System.ComponentModel.TypeConverter(typeof(CertificateConfigurationUpdateTypeConverter))] - public partial interface ICertificateConfigurationUpdate - - { - - } -} \ No newline at end of file diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/CertificateConfigurationUpdate.TypeConverter.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/CertificateConfigurationUpdate.TypeConverter.cs deleted file mode 100644 index 9b29ac2f5ec1..000000000000 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/CertificateConfigurationUpdate.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.DeviceRegistry.Models -{ - using Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.PowerShell; - - /// - /// A PowerShell PSTypeConverter to support converting to an instance of - /// - public partial class CertificateConfigurationUpdateTypeConverter : 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.DeviceRegistry.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Models.ICertificateConfigurationUpdate ConvertFrom(dynamic sourceValue) - { - if (null == sourceValue) - { - return null; - } - global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICertificateConfigurationUpdate).IsAssignableFrom(type)) - { - return sourceValue; - } - try - { - return CertificateConfigurationUpdate.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; - } - catch - { - // Unable to use JSON pattern - } - if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) - { - return CertificateConfigurationUpdate.DeserializeFromPSObject(sourceValue); - } - if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) - { - return CertificateConfigurationUpdate.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/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/CertificateConfigurationUpdate.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/CertificateConfigurationUpdate.cs deleted file mode 100644 index 61c0ef11b57e..000000000000 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/CertificateConfigurationUpdate.cs +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models -{ - using static Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Extensions; - - /// The certificate configuration. - public partial class CertificateConfigurationUpdate : - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICertificateConfigurationUpdate, - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICertificateConfigurationUpdateInternal - { - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAny _certificateAuthorityConfiguration; - - /// The configuration to set up an ICA. - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Origin(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAny CertificateAuthorityConfiguration { get => (this._certificateAuthorityConfiguration = this._certificateAuthorityConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.Any()); set => this._certificateAuthorityConfiguration = value; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ILeafCertificateConfigurationUpdate _leafCertificateConfiguration; - - /// The leaf certificate configuration. - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Origin(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ILeafCertificateConfigurationUpdate LeafCertificateConfiguration { get => (this._leafCertificateConfiguration = this._leafCertificateConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.LeafCertificateConfigurationUpdate()); set => this._leafCertificateConfiguration = value; } - - /// The validity period in days. - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Origin(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.PropertyOrigin.Inlined)] - public int? LeafCertificateConfigurationValidityPeriodInDay { get => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ILeafCertificateConfigurationUpdateInternal)LeafCertificateConfiguration).ValidityPeriodInDay; set => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ILeafCertificateConfigurationUpdateInternal)LeafCertificateConfiguration).ValidityPeriodInDay = value ?? default(int); } - - /// Internal Acessors for LeafCertificateConfiguration - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ILeafCertificateConfigurationUpdate Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICertificateConfigurationUpdateInternal.LeafCertificateConfiguration { get => (this._leafCertificateConfiguration = this._leafCertificateConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.LeafCertificateConfigurationUpdate()); set { {_leafCertificateConfiguration = value;} } } - - /// Creates an new instance. - public CertificateConfigurationUpdate() - { - - } - } - /// The certificate configuration. - public partial interface ICertificateConfigurationUpdate : - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IJsonSerializable - { - /// The configuration to set up an ICA. - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Info( - Required = false, - ReadOnly = false, - Read = true, - Create = true, - Update = true, - Description = @"The configuration to set up an ICA.", - SerializedName = @"certificateAuthorityConfiguration", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAny) })] - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAny CertificateAuthorityConfiguration { get; set; } - /// The validity period in days. - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Info( - Required = false, - ReadOnly = false, - Read = true, - Create = true, - Update = true, - Description = @"The validity period in days.", - SerializedName = @"validityPeriodInDays", - PossibleTypes = new [] { typeof(int) })] - int? LeafCertificateConfigurationValidityPeriodInDay { get; set; } - - } - /// The certificate configuration. - internal partial interface ICertificateConfigurationUpdateInternal - - { - /// The configuration to set up an ICA. - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAny CertificateAuthorityConfiguration { get; set; } - /// The leaf certificate configuration. - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ILeafCertificateConfigurationUpdate LeafCertificateConfiguration { get; set; } - /// The validity period in days. - int? LeafCertificateConfigurationValidityPeriodInDay { get; set; } - - } -} \ No newline at end of file diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/CertificateConfigurationUpdate.json.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/CertificateConfigurationUpdate.json.cs deleted file mode 100644 index 76ef904cae7e..000000000000 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/CertificateConfigurationUpdate.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.DeviceRegistry.Models -{ - using static Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Extensions; - - /// The certificate configuration. - public partial class CertificateConfigurationUpdate - { - - /// - /// 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.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.Runtime.Json.JsonObject container, ref bool returnNow); - - /// - /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonObject into a new instance of . - /// - /// A Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonObject instance to deserialize from. - internal CertificateConfigurationUpdate(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonObject json) - { - bool returnNow = false; - BeforeFromJson(json, ref returnNow); - if (returnNow) - { - return; - } - {_leafCertificateConfiguration = If( json?.PropertyT("leafCertificateConfiguration"), out var __jsonLeafCertificateConfiguration) ? Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.LeafCertificateConfigurationUpdate.FromJson(__jsonLeafCertificateConfiguration) : _leafCertificateConfiguration;} - {_certificateAuthorityConfiguration = If( json?.PropertyT("certificateAuthorityConfiguration"), out var __jsonCertificateAuthorityConfiguration) ? Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.Any.FromJson(__jsonCertificateAuthorityConfiguration) : _certificateAuthorityConfiguration;} - AfterFromJson(json); - } - - /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICertificateConfigurationUpdate. - /// - /// a to deserialize from. - /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICertificateConfigurationUpdate. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICertificateConfigurationUpdate FromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode node) - { - return node is Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonObject json ? new CertificateConfigurationUpdate(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.DeviceRegistry.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode serializationMode) - { - container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonObject(); - - bool returnNow = false; - BeforeToJson(ref container, ref returnNow); - if (returnNow) - { - return container; - } - AddIf( null != this._leafCertificateConfiguration ? (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode) this._leafCertificateConfiguration.ToJson(null,serializationMode) : null, "leafCertificateConfiguration" ,container.Add ); - AddIf( null != this._certificateAuthorityConfiguration ? (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode) this._certificateAuthorityConfiguration.ToJson(null,serializationMode) : null, "certificateAuthorityConfiguration" ,container.Add ); - AfterToJson(ref container); - return container; - } - } -} \ No newline at end of file diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/Credential.PowerShell.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/Credential.PowerShell.cs deleted file mode 100644 index 4b7289b851d4..000000000000 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/Credential.PowerShell.cs +++ /dev/null @@ -1,268 +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.DeviceRegistry.Models -{ - using Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.PowerShell; - - /// A Credential Resource - [System.ComponentModel.TypeConverter(typeof(CredentialTypeConverter))] - public partial class Credential - { - - /// - /// 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 Credential(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.DeviceRegistry.Models.ICredentialInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICredentialProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICredentialInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.CredentialPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("SystemDataCreatedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataCreatedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Models.IResourceInternal)this).SystemDataCreatedByType = (string) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IResourceInternal)this).SystemDataCreatedByType, global::System.Convert.ToString); - } - if (content.Contains("SystemDataLastModifiedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataLastModifiedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IResourceInternal)this).SystemDataLastModifiedByType = (string) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IResourceInternal)this).SystemDataLastModifiedByType, global::System.Convert.ToString); - } - if (content.Contains("SystemDataLastModifiedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Models.IResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.SystemDataTypeConverter.ConvertFrom); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IResourceInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IResourceInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IResourceInternal)this).Type, global::System.Convert.ToString); - } - if (content.Contains("Tag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.TrackedResourceTagsTypeConverter.ConvertFrom); - } - if (content.Contains("Location")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ITrackedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ITrackedResourceInternal)this).Location, global::System.Convert.ToString); - } - if (content.Contains("ProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICredentialInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICredentialInternal)this).ProvisioningState, 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 Credential(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.DeviceRegistry.Models.ICredentialInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICredentialProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICredentialInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.CredentialPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("SystemDataCreatedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataCreatedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Models.IResourceInternal)this).SystemDataCreatedByType = (string) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IResourceInternal)this).SystemDataCreatedByType, global::System.Convert.ToString); - } - if (content.Contains("SystemDataLastModifiedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataLastModifiedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IResourceInternal)this).SystemDataLastModifiedByType = (string) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IResourceInternal)this).SystemDataLastModifiedByType, global::System.Convert.ToString); - } - if (content.Contains("SystemDataLastModifiedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Models.IResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.SystemDataTypeConverter.ConvertFrom); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IResourceInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IResourceInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IResourceInternal)this).Type, global::System.Convert.ToString); - } - if (content.Contains("Tag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.TrackedResourceTagsTypeConverter.ConvertFrom); - } - if (content.Contains("Location")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ITrackedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ITrackedResourceInternal)this).Location, global::System.Convert.ToString); - } - if (content.Contains("ProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICredentialInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICredentialInternal)this).ProvisioningState, 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.DeviceRegistry.Models.ICredential DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new Credential(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.DeviceRegistry.Models.ICredential DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new Credential(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.DeviceRegistry.Models.ICredential FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.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(); - } - } - /// A Credential Resource - [System.ComponentModel.TypeConverter(typeof(CredentialTypeConverter))] - public partial interface ICredential - - { - - } -} \ No newline at end of file diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/Credential.TypeConverter.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/Credential.TypeConverter.cs deleted file mode 100644 index 2940f1d4174f..000000000000 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/Credential.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.DeviceRegistry.Models -{ - using Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.PowerShell; - - /// - /// A PowerShell PSTypeConverter to support converting to an instance of - /// - public partial class CredentialTypeConverter : 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.DeviceRegistry.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Models.ICredential ConvertFrom(dynamic sourceValue) - { - if (null == sourceValue) - { - return null; - } - global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICredential).IsAssignableFrom(type)) - { - return sourceValue; - } - try - { - return Credential.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; - } - catch - { - // Unable to use JSON pattern - } - if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) - { - return Credential.DeserializeFromPSObject(sourceValue); - } - if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) - { - return Credential.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/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/Credential.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/Credential.cs deleted file mode 100644 index 067ba90bbfe6..000000000000 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/Credential.cs +++ /dev/null @@ -1,175 +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.DeviceRegistry.Models -{ - using static Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Extensions; - - /// A Credential Resource - public partial class Credential : - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICredential, - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICredentialInternal, - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IValidates - { - /// - /// Backing field for Inherited model - /// - private Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ITrackedResource __trackedResource = new Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.TrackedResource(); - - /// - /// Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" - /// - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Origin(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.PropertyOrigin.Inherited)] - public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IResourceInternal)__trackedResource).Id; } - - /// The geo-location where the resource lives - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Origin(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.PropertyOrigin.Inherited)] - public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ITrackedResourceInternal)__trackedResource).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ITrackedResourceInternal)__trackedResource).Location = value ?? null; } - - /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICredentialProperties Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICredentialInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.CredentialProperties()); set { {_property = value;} } } - - /// Internal Acessors for ProvisioningState - string Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICredentialInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICredentialPropertiesInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICredentialPropertiesInternal)Property).ProvisioningState = value ?? null; } - - /// Internal Acessors for Id - string Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IResourceInternal)__trackedResource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IResourceInternal)__trackedResource).Id = value ?? null; } - - /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IResourceInternal)__trackedResource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IResourceInternal)__trackedResource).Name = value ?? null; } - - /// Internal Acessors for SystemData - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ISystemData Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IResourceInternal.SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IResourceInternal)__trackedResource).SystemData; set => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IResourceInternal)__trackedResource).SystemData = value ?? null /* model class */; } - - /// Internal Acessors for SystemDataCreatedAt - global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IResourceInternal.SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IResourceInternal)__trackedResource).SystemDataCreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IResourceInternal)__trackedResource).SystemDataCreatedAt = value ?? default(global::System.DateTime); } - - /// Internal Acessors for SystemDataCreatedBy - string Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IResourceInternal.SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IResourceInternal)__trackedResource).SystemDataCreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IResourceInternal)__trackedResource).SystemDataCreatedBy = value ?? null; } - - /// Internal Acessors for SystemDataCreatedByType - string Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IResourceInternal.SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IResourceInternal)__trackedResource).SystemDataCreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IResourceInternal)__trackedResource).SystemDataCreatedByType = value ?? null; } - - /// Internal Acessors for SystemDataLastModifiedAt - global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IResourceInternal.SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedAt = value ?? default(global::System.DateTime); } - - /// Internal Acessors for SystemDataLastModifiedBy - string Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IResourceInternal.SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedBy = value ?? null; } - - /// Internal Acessors for SystemDataLastModifiedByType - string Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IResourceInternal.SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedByType = value ?? null; } - - /// Internal Acessors for Type - string Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IResourceInternal)__trackedResource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IResourceInternal)__trackedResource).Type = value ?? null; } - - /// The name of the resource - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Origin(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.PropertyOrigin.Inherited)] - public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IResourceInternal)__trackedResource).Name; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICredentialProperties _property; - - /// The resource-specific properties for this resource. - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Origin(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICredentialProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.CredentialProperties()); set => this._property = value; } - - /// The status of the last operation. - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Origin(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.PropertyOrigin.Inlined)] - public string ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICredentialPropertiesInternal)Property).ProvisioningState; } - - /// Gets the resource group name - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Origin(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Origin(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.PropertyOrigin.Inherited)] - internal Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ISystemData SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IResourceInternal)__trackedResource).SystemData; set => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IResourceInternal)__trackedResource).SystemData = value ?? null /* model class */; } - - /// The timestamp of resource creation (UTC). - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Origin(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.PropertyOrigin.Inherited)] - public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IResourceInternal)__trackedResource).SystemDataCreatedAt; } - - /// The identity that created the resource. - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Origin(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.PropertyOrigin.Inherited)] - public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IResourceInternal)__trackedResource).SystemDataCreatedBy; } - - /// The type of identity that created the resource. - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Origin(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.PropertyOrigin.Inherited)] - public string SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IResourceInternal)__trackedResource).SystemDataCreatedByType; } - - /// The timestamp of resource last modification (UTC) - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Origin(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.PropertyOrigin.Inherited)] - public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedAt; } - - /// The identity that last modified the resource. - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Origin(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.PropertyOrigin.Inherited)] - public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedBy; } - - /// The type of identity that last modified the resource. - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Origin(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.PropertyOrigin.Inherited)] - public string SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedByType; } - - /// Resource tags. - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Origin(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ITrackedResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ITrackedResourceInternal)__trackedResource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ITrackedResourceInternal)__trackedResource).Tag = value ?? null /* model class */; } - - /// - /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - /// - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Origin(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.PropertyOrigin.Inherited)] - public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IResourceInternal)__trackedResource).Type; } - - /// Creates an new instance. - public Credential() - { - - } - - /// 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.DeviceRegistry.Runtime.IEventListener eventListener) - { - await eventListener.AssertNotNull(nameof(__trackedResource), __trackedResource); - await eventListener.AssertObjectIsValid(nameof(__trackedResource), __trackedResource); - } - } - /// A Credential Resource - public partial interface ICredential : - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ITrackedResource - { - /// The status of the last operation. - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Info( - Required = false, - ReadOnly = true, - Read = true, - Create = false, - Update = false, - Description = @"The status of the last operation.", - SerializedName = @"provisioningState", - PossibleTypes = new [] { typeof(string) })] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.PSArgumentCompleterAttribute("Succeeded", "Failed", "Canceled", "Accepted", "Deleting")] - string ProvisioningState { get; } - - } - /// A Credential Resource - internal partial interface ICredentialInternal : - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ITrackedResourceInternal - { - /// The resource-specific properties for this resource. - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICredentialProperties Property { get; set; } - /// The status of the last operation. - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.PSArgumentCompleterAttribute("Succeeded", "Failed", "Canceled", "Accepted", "Deleting")] - string ProvisioningState { get; set; } - - } -} \ No newline at end of file diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/Credential.json.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/Credential.json.cs deleted file mode 100644 index b0a6035b26e3..000000000000 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/Credential.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.DeviceRegistry.Models -{ - using static Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Extensions; - - /// A Credential Resource - public partial class Credential - { - - /// - /// 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.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.Runtime.Json.JsonObject container, ref bool returnNow); - - /// - /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonObject into a new instance of . - /// - /// A Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonObject instance to deserialize from. - internal Credential(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonObject json) - { - bool returnNow = false; - BeforeFromJson(json, ref returnNow); - if (returnNow) - { - return; - } - __trackedResource = new Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.TrackedResource(json); - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.CredentialProperties.FromJson(__jsonProperties) : _property;} - AfterFromJson(json); - } - - /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICredential. - /// - /// a to deserialize from. - /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICredential. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICredential FromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode node) - { - return node is Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonObject json ? new Credential(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.DeviceRegistry.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode serializationMode) - { - container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.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/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/CredentialListResult.PowerShell.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/CredentialListResult.PowerShell.cs deleted file mode 100644 index 285c01b06bc0..000000000000 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/CredentialListResult.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.DeviceRegistry.Models -{ - using Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.PowerShell; - - /// The response of a Credential list operation. - [System.ComponentModel.TypeConverter(typeof(CredentialListResultTypeConverter))] - public partial class CredentialListResult - { - - /// - /// 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 CredentialListResult(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.DeviceRegistry.Models.ICredentialListResultInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICredentialListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.CredentialTypeConverter.ConvertFrom)); - } - if (content.Contains("NextLink")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICredentialListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICredentialListResultInternal)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 CredentialListResult(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.DeviceRegistry.Models.ICredentialListResultInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICredentialListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.CredentialTypeConverter.ConvertFrom)); - } - if (content.Contains("NextLink")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICredentialListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICredentialListResultInternal)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.DeviceRegistry.Models.ICredentialListResult DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new CredentialListResult(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.DeviceRegistry.Models.ICredentialListResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new CredentialListResult(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.DeviceRegistry.Models.ICredentialListResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.SerializationMode.IncludeAll)?.ToString(); - - public override string ToString() - { - var returnNow = false; - var result = global::System.String.Empty; - OverrideToString(ref result, ref returnNow); - if (returnNow) - { - return result; - } - return ToJsonString(); - } - } - /// The response of a Credential list operation. - [System.ComponentModel.TypeConverter(typeof(CredentialListResultTypeConverter))] - public partial interface ICredentialListResult - - { - - } -} \ No newline at end of file diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/CredentialListResult.TypeConverter.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/CredentialListResult.TypeConverter.cs deleted file mode 100644 index 52313c55a493..000000000000 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/CredentialListResult.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.DeviceRegistry.Models -{ - using Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.PowerShell; - - /// - /// A PowerShell PSTypeConverter to support converting to an instance of - /// - public partial class CredentialListResultTypeConverter : 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.DeviceRegistry.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Models.ICredentialListResult ConvertFrom(dynamic sourceValue) - { - if (null == sourceValue) - { - return null; - } - global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICredentialListResult).IsAssignableFrom(type)) - { - return sourceValue; - } - try - { - return CredentialListResult.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; - } - catch - { - // Unable to use JSON pattern - } - if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) - { - return CredentialListResult.DeserializeFromPSObject(sourceValue); - } - if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) - { - return CredentialListResult.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/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/CredentialListResult.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/CredentialListResult.cs deleted file mode 100644 index 8648b2cd127e..000000000000 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/CredentialListResult.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.DeviceRegistry.Models -{ - using static Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Extensions; - - /// The response of a Credential list operation. - public partial class CredentialListResult : - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICredentialListResult, - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICredentialListResultInternal - { - - /// Backing field for property. - private string _nextLink; - - /// The link to the next page of items - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Origin(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.PropertyOrigin.Owned)] - public string NextLink { get => this._nextLink; set => this._nextLink = value; } - - /// Backing field for property. - private System.Collections.Generic.List _value; - - /// The Credential items on this page - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Origin(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.PropertyOrigin.Owned)] - public System.Collections.Generic.List Value { get => this._value; set => this._value = value; } - - /// Creates an new instance. - public CredentialListResult() - { - - } - } - /// The response of a Credential list operation. - public partial interface ICredentialListResult : - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IJsonSerializable - { - /// The link to the next page of items - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Info( - Required = false, - ReadOnly = false, - Read = true, - Create = true, - Update = true, - Description = @"The link to the next page of items", - SerializedName = @"nextLink", - PossibleTypes = new [] { typeof(string) })] - string NextLink { get; set; } - /// The Credential items on this page - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Info( - Required = true, - ReadOnly = false, - Read = true, - Create = true, - Update = true, - Description = @"The Credential items on this page", - SerializedName = @"value", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICredential) })] - System.Collections.Generic.List Value { get; set; } - - } - /// The response of a Credential list operation. - internal partial interface ICredentialListResultInternal - - { - /// The link to the next page of items - string NextLink { get; set; } - /// The Credential items on this page - System.Collections.Generic.List Value { get; set; } - - } -} \ No newline at end of file diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/CredentialListResult.json.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/CredentialListResult.json.cs deleted file mode 100644 index 3879c56e6adb..000000000000 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/CredentialListResult.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.DeviceRegistry.Models -{ - using static Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Extensions; - - /// The response of a Credential list operation. - public partial class CredentialListResult - { - - /// - /// 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.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.Runtime.Json.JsonObject container, ref bool returnNow); - - /// - /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonObject into a new instance of . - /// - /// A Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonObject instance to deserialize from. - internal CredentialListResult(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.Models.ICredential) (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.Credential.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.DeviceRegistry.Models.ICredentialListResult. - /// - /// a to deserialize from. - /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICredentialListResult. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICredentialListResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode node) - { - return node is Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonObject json ? new CredentialListResult(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.DeviceRegistry.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode serializationMode) - { - container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/CredentialProperties.PowerShell.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/CredentialProperties.PowerShell.cs deleted file mode 100644 index 1f20d7a71c12..000000000000 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/CredentialProperties.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.DeviceRegistry.Models -{ - using Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.PowerShell; - - /// Details of the Credential Resource. - [System.ComponentModel.TypeConverter(typeof(CredentialPropertiesTypeConverter))] - public partial class CredentialProperties - { - - /// - /// 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 CredentialProperties(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.DeviceRegistry.Models.ICredentialPropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICredentialPropertiesInternal)this).ProvisioningState, 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 CredentialProperties(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.DeviceRegistry.Models.ICredentialPropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICredentialPropertiesInternal)this).ProvisioningState, 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.DeviceRegistry.Models.ICredentialProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new CredentialProperties(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.DeviceRegistry.Models.ICredentialProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new CredentialProperties(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.DeviceRegistry.Models.ICredentialProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.SerializationMode.IncludeAll)?.ToString(); - - public override string ToString() - { - var returnNow = false; - var result = global::System.String.Empty; - OverrideToString(ref result, ref returnNow); - if (returnNow) - { - return result; - } - return ToJsonString(); - } - } - /// Details of the Credential Resource. - [System.ComponentModel.TypeConverter(typeof(CredentialPropertiesTypeConverter))] - public partial interface ICredentialProperties - - { - - } -} \ No newline at end of file diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/CredentialProperties.TypeConverter.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/CredentialProperties.TypeConverter.cs deleted file mode 100644 index c389a682703c..000000000000 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/CredentialProperties.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.DeviceRegistry.Models -{ - using Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.PowerShell; - - /// - /// A PowerShell PSTypeConverter to support converting to an instance of - /// - public partial class CredentialPropertiesTypeConverter : 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.DeviceRegistry.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Models.ICredentialProperties ConvertFrom(dynamic sourceValue) - { - if (null == sourceValue) - { - return null; - } - global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICredentialProperties).IsAssignableFrom(type)) - { - return sourceValue; - } - try - { - return CredentialProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; - } - catch - { - // Unable to use JSON pattern - } - if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) - { - return CredentialProperties.DeserializeFromPSObject(sourceValue); - } - if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) - { - return CredentialProperties.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/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/CredentialProperties.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/CredentialProperties.cs deleted file mode 100644 index 18eeb60b9f8a..000000000000 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/CredentialProperties.cs +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models -{ - using static Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Extensions; - - /// Details of the Credential Resource. - public partial class CredentialProperties : - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICredentialProperties, - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICredentialPropertiesInternal - { - - /// Internal Acessors for ProvisioningState - string Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICredentialPropertiesInternal.ProvisioningState { get => this._provisioningState; set { {_provisioningState = value;} } } - - /// Backing field for property. - private string _provisioningState; - - /// The status of the last operation. - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Origin(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.PropertyOrigin.Owned)] - public string ProvisioningState { get => this._provisioningState; } - - /// Creates an new instance. - public CredentialProperties() - { - - } - } - /// Details of the Credential Resource. - public partial interface ICredentialProperties : - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IJsonSerializable - { - /// The status of the last operation. - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Info( - Required = false, - ReadOnly = true, - Read = true, - Create = false, - Update = false, - Description = @"The status of the last operation.", - SerializedName = @"provisioningState", - PossibleTypes = new [] { typeof(string) })] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.PSArgumentCompleterAttribute("Succeeded", "Failed", "Canceled", "Accepted", "Deleting")] - string ProvisioningState { get; } - - } - /// Details of the Credential Resource. - internal partial interface ICredentialPropertiesInternal - - { - /// The status of the last operation. - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.PSArgumentCompleterAttribute("Succeeded", "Failed", "Canceled", "Accepted", "Deleting")] - string ProvisioningState { get; set; } - - } -} \ No newline at end of file diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/CredentialProperties.json.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/CredentialProperties.json.cs deleted file mode 100644 index b2f3b879e7cb..000000000000 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/CredentialProperties.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.DeviceRegistry.Models -{ - using static Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Extensions; - - /// Details of the Credential Resource. - public partial class CredentialProperties - { - - /// - /// 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.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.Runtime.Json.JsonObject container, ref bool returnNow); - - /// - /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonObject into a new instance of . - /// - /// A Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonObject instance to deserialize from. - internal CredentialProperties(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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;} - AfterFromJson(json); - } - - /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICredentialProperties. - /// - /// a to deserialize from. - /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICredentialProperties. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICredentialProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode node) - { - return node is Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonObject json ? new CredentialProperties(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.DeviceRegistry.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode serializationMode) - { - container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonObject(); - - bool returnNow = false; - BeforeToJson(ref container, ref returnNow); - if (returnNow) - { - return container; - } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeRead)) - { - AddIf( null != (((object)this._provisioningState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/CredentialUpdate.PowerShell.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/CredentialUpdate.PowerShell.cs deleted file mode 100644 index a794fe5e1934..000000000000 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/CredentialUpdate.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.DeviceRegistry.Models -{ - using Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.PowerShell; - - /// The type used for update operations of the Credential. - [System.ComponentModel.TypeConverter(typeof(CredentialUpdateTypeConverter))] - public partial class CredentialUpdate - { - - /// - /// 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 CredentialUpdate(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("Tag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICredentialUpdateInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICredentialUpdateTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICredentialUpdateInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.CredentialUpdateTagsTypeConverter.ConvertFrom); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal CredentialUpdate(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("Tag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICredentialUpdateInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICredentialUpdateTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICredentialUpdateInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.CredentialUpdateTagsTypeConverter.ConvertFrom); - } - AfterDeserializePSObject(content); - } - - /// - /// Deserializes a into an instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICredentialUpdate DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new CredentialUpdate(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.DeviceRegistry.Models.ICredentialUpdate DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new CredentialUpdate(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.DeviceRegistry.Models.ICredentialUpdate FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.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 type used for update operations of the Credential. - [System.ComponentModel.TypeConverter(typeof(CredentialUpdateTypeConverter))] - public partial interface ICredentialUpdate - - { - - } -} \ No newline at end of file diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/CredentialUpdate.TypeConverter.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/CredentialUpdate.TypeConverter.cs deleted file mode 100644 index 271fee0d1423..000000000000 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/CredentialUpdate.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.DeviceRegistry.Models -{ - using Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.PowerShell; - - /// - /// A PowerShell PSTypeConverter to support converting to an instance of - /// - public partial class CredentialUpdateTypeConverter : 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.DeviceRegistry.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Models.ICredentialUpdate ConvertFrom(dynamic sourceValue) - { - if (null == sourceValue) - { - return null; - } - global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICredentialUpdate).IsAssignableFrom(type)) - { - return sourceValue; - } - try - { - return CredentialUpdate.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; - } - catch - { - // Unable to use JSON pattern - } - if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) - { - return CredentialUpdate.DeserializeFromPSObject(sourceValue); - } - if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) - { - return CredentialUpdate.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/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/CredentialUpdate.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/CredentialUpdate.cs deleted file mode 100644 index e61a33677c71..000000000000 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/CredentialUpdate.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.DeviceRegistry.Models -{ - using static Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Extensions; - - /// The type used for update operations of the Credential. - public partial class CredentialUpdate : - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICredentialUpdate, - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICredentialUpdateInternal - { - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICredentialUpdateTags _tag; - - /// Resource tags. - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Origin(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICredentialUpdateTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.CredentialUpdateTags()); set => this._tag = value; } - - /// Creates an new instance. - public CredentialUpdate() - { - - } - } - /// The type used for update operations of the Credential. - public partial interface ICredentialUpdate : - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IJsonSerializable - { - /// Resource tags. - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Info( - Required = false, - ReadOnly = false, - Read = true, - Create = true, - Update = true, - Description = @"Resource tags.", - SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICredentialUpdateTags) })] - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICredentialUpdateTags Tag { get; set; } - - } - /// The type used for update operations of the Credential. - internal partial interface ICredentialUpdateInternal - - { - /// Resource tags. - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICredentialUpdateTags Tag { get; set; } - - } -} \ No newline at end of file diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/CredentialUpdate.json.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/CredentialUpdate.json.cs deleted file mode 100644 index f14ac5d04846..000000000000 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/CredentialUpdate.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.DeviceRegistry.Models -{ - using static Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Extensions; - - /// The type used for update operations of the Credential. - public partial class CredentialUpdate - { - - /// - /// 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.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.Runtime.Json.JsonObject container, ref bool returnNow); - - /// - /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonObject into a new instance of . - /// - /// A Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonObject instance to deserialize from. - internal CredentialUpdate(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonObject json) - { - bool returnNow = false; - BeforeFromJson(json, ref returnNow); - if (returnNow) - { - return; - } - {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.CredentialUpdateTags.FromJson(__jsonTags) : _tag;} - AfterFromJson(json); - } - - /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICredentialUpdate. - /// - /// a to deserialize from. - /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICredentialUpdate. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICredentialUpdate FromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode node) - { - return node is Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonObject json ? new CredentialUpdate(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.DeviceRegistry.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode serializationMode) - { - container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonObject(); - - bool returnNow = false; - BeforeToJson(ref container, ref returnNow); - if (returnNow) - { - return container; - } - AddIf( null != this._tag ? (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode) this._tag.ToJson(null,serializationMode) : null, "tags" ,container.Add ); - AfterToJson(ref container); - return container; - } - } -} \ No newline at end of file diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/CredentialUpdateTags.PowerShell.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/CredentialUpdateTags.PowerShell.cs deleted file mode 100644 index 0e42df7ae645..000000000000 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/CredentialUpdateTags.PowerShell.cs +++ /dev/null @@ -1,160 +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.DeviceRegistry.Models -{ - using Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.PowerShell; - - /// Resource tags. - [System.ComponentModel.TypeConverter(typeof(CredentialUpdateTagsTypeConverter))] - public partial class CredentialUpdateTags - { - - /// - /// 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 CredentialUpdateTags(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - // this type is a dictionary; copy elements from source to here. - CopyFrom(content); - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal CredentialUpdateTags(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - // this type is a dictionary; copy elements from source to here. - CopyFrom(content); - AfterDeserializePSObject(content); - } - - /// - /// Deserializes a into an instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICredentialUpdateTags DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new CredentialUpdateTags(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.DeviceRegistry.Models.ICredentialUpdateTags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new CredentialUpdateTags(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.DeviceRegistry.Models.ICredentialUpdateTags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.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(); - } - } - /// Resource tags. - [System.ComponentModel.TypeConverter(typeof(CredentialUpdateTagsTypeConverter))] - public partial interface ICredentialUpdateTags - - { - - } -} \ No newline at end of file diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/CredentialUpdateTags.TypeConverter.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/CredentialUpdateTags.TypeConverter.cs deleted file mode 100644 index e97e5be1beb3..000000000000 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/CredentialUpdateTags.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.DeviceRegistry.Models -{ - using Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.PowerShell; - - /// - /// A PowerShell PSTypeConverter to support converting to an instance of - /// - public partial class CredentialUpdateTagsTypeConverter : 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.DeviceRegistry.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Models.ICredentialUpdateTags ConvertFrom(dynamic sourceValue) - { - if (null == sourceValue) - { - return null; - } - global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICredentialUpdateTags).IsAssignableFrom(type)) - { - return sourceValue; - } - try - { - return CredentialUpdateTags.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; - } - catch - { - // Unable to use JSON pattern - } - if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) - { - return CredentialUpdateTags.DeserializeFromPSObject(sourceValue); - } - if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) - { - return CredentialUpdateTags.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/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/CredentialUpdateTags.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/CredentialUpdateTags.cs deleted file mode 100644 index ef7cb596611c..000000000000 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/CredentialUpdateTags.cs +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models -{ - using static Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Extensions; - - /// Resource tags. - public partial class CredentialUpdateTags : - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICredentialUpdateTags, - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICredentialUpdateTagsInternal - { - - /// Creates an new instance. - public CredentialUpdateTags() - { - - } - } - /// Resource tags. - public partial interface ICredentialUpdateTags : - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IAssociativeArray - { - - } - /// Resource tags. - internal partial interface ICredentialUpdateTagsInternal - - { - - } -} \ No newline at end of file diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/CredentialUpdateTags.dictionary.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/CredentialUpdateTags.dictionary.cs deleted file mode 100644 index da56e6ee3c86..000000000000 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/CredentialUpdateTags.dictionary.cs +++ /dev/null @@ -1,75 +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.DeviceRegistry.Models -{ - using static Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Extensions; - - public partial class CredentialUpdateTags : - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IAssociativeArray - { - protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); - - global::System.Collections.Generic.IDictionary Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IAssociativeArray.AdditionalProperties { get => __additionalProperties; } - - int Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IAssociativeArray.Count { get => __additionalProperties.Count; } - - global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IAssociativeArray.Keys { get => __additionalProperties.Keys; } - - global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IAssociativeArray.Values { get => __additionalProperties.Values; } - - public string this[global::System.String index] { get => __additionalProperties[index]; set => __additionalProperties[index] = value; } - - /// - /// - public void Add(global::System.String key, string value) => __additionalProperties.Add( key, value); - - public void Clear() => __additionalProperties.Clear(); - - /// - public bool ContainsKey(global::System.String key) => __additionalProperties.ContainsKey( key); - - /// - public void CopyFrom(global::System.Collections.IDictionary source) - { - if (null != source) - { - foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) - { - if ((null != property.Key && null != property.Value)) - { - this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); - } - } - } - } - - /// - public void CopyFrom(global::System.Management.Automation.PSObject source) - { - if (null != source) - { - foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) - { - if ((null != property.Key && null != property.Value)) - { - this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); - } - } - } - } - - /// - public bool Remove(global::System.String key) => __additionalProperties.Remove( key); - - /// - /// - public bool TryGetValue(global::System.String key, out string value) => __additionalProperties.TryGetValue( key, out value); - - /// - - public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.CredentialUpdateTags source) => source.__additionalProperties; - } -} \ No newline at end of file diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/CredentialUpdateTags.json.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/CredentialUpdateTags.json.cs deleted file mode 100644 index 554c907b8533..000000000000 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/CredentialUpdateTags.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.DeviceRegistry.Models -{ - using static Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Extensions; - - /// Resource tags. - public partial class CredentialUpdateTags - { - - /// - /// 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.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.Runtime.Json.JsonObject container, ref bool returnNow); - - /// - /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonObject into a new instance of . - /// - /// A Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonObject instance to deserialize from. - /// - internal CredentialUpdateTags(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) - { - bool returnNow = false; - BeforeFromJson(json, ref returnNow); - if (returnNow) - { - return; - } - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IAssociativeArray)this).AdditionalProperties, null ,exclusions ); - AfterFromJson(json); - } - - /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICredentialUpdateTags. - /// - /// a to deserialize from. - /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICredentialUpdateTags. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICredentialUpdateTags FromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode node) - { - return node is Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonObject json ? new CredentialUpdateTags(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.DeviceRegistry.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode serializationMode) - { - container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonObject(); - - bool returnNow = false; - BeforeToJson(ref container, ref returnNow); - if (returnNow) - { - return container; - } - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IAssociativeArray)this).AdditionalProperties, container); - AfterToJson(ref container); - return container; - } - } -} \ No newline at end of file diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/DeviceCredentialPolicy.PowerShell.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/DeviceCredentialPolicy.PowerShell.cs deleted file mode 100644 index e778fc744b75..000000000000 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/DeviceCredentialPolicy.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.DeviceRegistry.Models -{ - using Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.PowerShell; - - /// Defines the Policy used to issue device certificates if any. - [System.ComponentModel.TypeConverter(typeof(DeviceCredentialPolicyTypeConverter))] - public partial class DeviceCredentialPolicy - { - - /// - /// 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.DeviceRegistry.Models.IDeviceCredentialPolicy DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new DeviceCredentialPolicy(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.DeviceRegistry.Models.IDeviceCredentialPolicy DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new DeviceCredentialPolicy(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal DeviceCredentialPolicy(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("ResourceId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IDeviceCredentialPolicyInternal)this).ResourceId = (string) content.GetValueForProperty("ResourceId",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IDeviceCredentialPolicyInternal)this).ResourceId, 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 DeviceCredentialPolicy(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("ResourceId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IDeviceCredentialPolicyInternal)this).ResourceId = (string) content.GetValueForProperty("ResourceId",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IDeviceCredentialPolicyInternal)this).ResourceId, global::System.Convert.ToString); - } - AfterDeserializePSObject(content); - } - - /// - /// Creates a new instance of , deserializing the content from a json string. - /// - /// a string containing a JSON serialized instance of this model. - /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IDeviceCredentialPolicy FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.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 Policy used to issue device certificates if any. - [System.ComponentModel.TypeConverter(typeof(DeviceCredentialPolicyTypeConverter))] - public partial interface IDeviceCredentialPolicy - - { - - } -} \ No newline at end of file diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/DeviceCredentialPolicy.TypeConverter.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/DeviceCredentialPolicy.TypeConverter.cs deleted file mode 100644 index 037f4697fd87..000000000000 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/DeviceCredentialPolicy.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.DeviceRegistry.Models -{ - using Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.PowerShell; - - /// - /// A PowerShell PSTypeConverter to support converting to an instance of - /// - public partial class DeviceCredentialPolicyTypeConverter : 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.DeviceRegistry.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Models.IDeviceCredentialPolicy ConvertFrom(dynamic sourceValue) - { - if (null == sourceValue) - { - return null; - } - global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IDeviceCredentialPolicy).IsAssignableFrom(type)) - { - return sourceValue; - } - try - { - return DeviceCredentialPolicy.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; - } - catch - { - // Unable to use JSON pattern - } - if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) - { - return DeviceCredentialPolicy.DeserializeFromPSObject(sourceValue); - } - if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) - { - return DeviceCredentialPolicy.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/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/DeviceCredentialPolicy.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/DeviceCredentialPolicy.cs deleted file mode 100644 index 7180019f1a45..000000000000 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/DeviceCredentialPolicy.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.DeviceRegistry.Models -{ - using static Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Extensions; - - /// Defines the Policy used to issue device certificates if any. - public partial class DeviceCredentialPolicy : - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IDeviceCredentialPolicy, - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IDeviceCredentialPolicyInternal - { - - /// Backing field for property. - private string _resourceId; - - /// Resource Id of the Policy. - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Origin(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.PropertyOrigin.Owned)] - public string ResourceId { get => this._resourceId; set => this._resourceId = value; } - - /// Creates an new instance. - public DeviceCredentialPolicy() - { - - } - } - /// Defines the Policy used to issue device certificates if any. - public partial interface IDeviceCredentialPolicy : - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IJsonSerializable - { - /// Resource Id of the Policy. - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Info( - Required = false, - ReadOnly = false, - Read = true, - Create = true, - Update = true, - Description = @"Resource Id of the Policy.", - SerializedName = @"resourceId", - PossibleTypes = new [] { typeof(string) })] - string ResourceId { get; set; } - - } - /// Defines the Policy used to issue device certificates if any. - internal partial interface IDeviceCredentialPolicyInternal - - { - /// Resource Id of the Policy. - string ResourceId { get; set; } - - } -} \ No newline at end of file diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/DeviceCredentialPolicy.json.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/DeviceCredentialPolicy.json.cs deleted file mode 100644 index 8b771bc95c17..000000000000 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/DeviceCredentialPolicy.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.DeviceRegistry.Models -{ - using static Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Extensions; - - /// Defines the Policy used to issue device certificates if any. - public partial class DeviceCredentialPolicy - { - - /// - /// 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.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.Runtime.Json.JsonObject container, ref bool returnNow); - - /// - /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonObject into a new instance of . - /// - /// A Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonObject instance to deserialize from. - internal DeviceCredentialPolicy(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonObject json) - { - bool returnNow = false; - BeforeFromJson(json, ref returnNow); - if (returnNow) - { - return; - } - {_resourceId = If( json?.PropertyT("resourceId"), out var __jsonResourceId) ? (string)__jsonResourceId : (string)_resourceId;} - AfterFromJson(json); - } - - /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IDeviceCredentialPolicy. - /// - /// a to deserialize from. - /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IDeviceCredentialPolicy. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IDeviceCredentialPolicy FromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode node) - { - return node is Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonObject json ? new DeviceCredentialPolicy(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.DeviceRegistry.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode serializationMode) - { - container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonObject(); - - bool returnNow = false; - BeforeToJson(ref container, ref returnNow); - if (returnNow) - { - return container; - } - AddIf( null != (((object)this._resourceId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonString(this._resourceId.ToString()) : null, "resourceId" ,container.Add ); - AfterToJson(ref container); - return container; - } - } -} \ No newline at end of file diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/DeviceRegistryIdentity.PowerShell.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/DeviceRegistryIdentity.PowerShell.cs index 6235baf4f2bb..00b924d8f364 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/DeviceRegistryIdentity.PowerShell.cs +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/DeviceRegistryIdentity.PowerShell.cs @@ -137,10 +137,6 @@ internal DeviceRegistryIdentity(global::System.Collections.IDictionary content) { ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IDeviceRegistryIdentityInternal)this).SchemaRegistryName = (string) content.GetValueForProperty("SchemaRegistryName",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IDeviceRegistryIdentityInternal)this).SchemaRegistryName, global::System.Convert.ToString); } - if (content.Contains("PolicyName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IDeviceRegistryIdentityInternal)this).PolicyName = (string) content.GetValueForProperty("PolicyName",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IDeviceRegistryIdentityInternal)this).PolicyName, global::System.Convert.ToString); - } if (content.Contains("DeviceName")) { ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IDeviceRegistryIdentityInternal)this).DeviceName = (string) content.GetValueForProperty("DeviceName",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IDeviceRegistryIdentityInternal)this).DeviceName, global::System.Convert.ToString); @@ -218,10 +214,6 @@ internal DeviceRegistryIdentity(global::System.Management.Automation.PSObject co { ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IDeviceRegistryIdentityInternal)this).SchemaRegistryName = (string) content.GetValueForProperty("SchemaRegistryName",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IDeviceRegistryIdentityInternal)this).SchemaRegistryName, global::System.Convert.ToString); } - if (content.Contains("PolicyName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IDeviceRegistryIdentityInternal)this).PolicyName = (string) content.GetValueForProperty("PolicyName",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IDeviceRegistryIdentityInternal)this).PolicyName, global::System.Convert.ToString); - } if (content.Contains("DeviceName")) { ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IDeviceRegistryIdentityInternal)this).DeviceName = (string) content.GetValueForProperty("DeviceName",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IDeviceRegistryIdentityInternal)this).DeviceName, global::System.Convert.ToString); diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/DeviceRegistryIdentity.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/DeviceRegistryIdentity.cs index 9c4f07ddfcfa..afa8847ac43a 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/DeviceRegistryIdentity.cs +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/DeviceRegistryIdentity.cs @@ -82,13 +82,6 @@ public partial class DeviceRegistryIdentity : [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Origin(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.PropertyOrigin.Owned)] public string OperationId { get => this._operationId; set => this._operationId = value; } - /// Backing field for property. - private string _policyName; - - /// The name of the Policy tracked resource. - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Origin(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.PropertyOrigin.Owned)] - public string PolicyName { get => this._policyName; set => this._policyName = value; } - /// Backing field for property. private string _resourceGroupName; @@ -243,17 +236,6 @@ public partial interface IDeviceRegistryIdentity : SerializedName = @"operationId", PossibleTypes = new [] { typeof(string) })] string OperationId { get; set; } - /// The name of the Policy tracked resource. - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Info( - Required = false, - ReadOnly = false, - Read = true, - Create = true, - Update = true, - Description = @"The name of the Policy tracked resource.", - SerializedName = @"policyName", - PossibleTypes = new [] { typeof(string) })] - string PolicyName { get; set; } /// The name of the resource group. The name is case insensitive. [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Info( Required = false, @@ -334,8 +316,6 @@ internal partial interface IDeviceRegistryIdentityInternal string NamespaceName { get; set; } /// The ID of an ongoing async operation. string OperationId { get; set; } - /// The name of the Policy tracked resource. - string PolicyName { get; set; } /// The name of the resource group. The name is case insensitive. string ResourceGroupName { get; set; } /// Schema name parameter. diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/DeviceRegistryIdentity.json.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/DeviceRegistryIdentity.json.cs index 755aa9cfe97d..8c0eec8bd409 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/DeviceRegistryIdentity.json.cs +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/DeviceRegistryIdentity.json.cs @@ -73,7 +73,6 @@ internal DeviceRegistryIdentity(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistr {_operationId = If( json?.PropertyT("operationId"), out var __jsonOperationId) ? (string)__jsonOperationId : (string)_operationId;} {_namespaceName = If( json?.PropertyT("namespaceName"), out var __jsonNamespaceName) ? (string)__jsonNamespaceName : (string)_namespaceName;} {_schemaRegistryName = If( json?.PropertyT("schemaRegistryName"), out var __jsonSchemaRegistryName) ? (string)__jsonSchemaRegistryName : (string)_schemaRegistryName;} - {_policyName = If( json?.PropertyT("policyName"), out var __jsonPolicyName) ? (string)__jsonPolicyName : (string)_policyName;} {_deviceName = If( json?.PropertyT("deviceName"), out var __jsonDeviceName) ? (string)__jsonDeviceName : (string)_deviceName;} {_discoveredAssetName = If( json?.PropertyT("discoveredAssetName"), out var __jsonDiscoveredAssetName) ? (string)__jsonDiscoveredAssetName : (string)_discoveredAssetName;} {_discoveredDeviceName = If( json?.PropertyT("discoveredDeviceName"), out var __jsonDiscoveredDeviceName) ? (string)__jsonDiscoveredDeviceName : (string)_discoveredDeviceName;} @@ -123,7 +122,6 @@ public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode T AddIf( null != (((object)this._operationId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonString(this._operationId.ToString()) : null, "operationId" ,container.Add ); AddIf( null != (((object)this._namespaceName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonString(this._namespaceName.ToString()) : null, "namespaceName" ,container.Add ); AddIf( null != (((object)this._schemaRegistryName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonString(this._schemaRegistryName.ToString()) : null, "schemaRegistryName" ,container.Add ); - AddIf( null != (((object)this._policyName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonString(this._policyName.ToString()) : null, "policyName" ,container.Add ); AddIf( null != (((object)this._deviceName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonString(this._deviceName.ToString()) : null, "deviceName" ,container.Add ); AddIf( null != (((object)this._discoveredAssetName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonString(this._discoveredAssetName.ToString()) : null, "discoveredAssetName" ,container.Add ); AddIf( null != (((object)this._discoveredDeviceName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonString(this._discoveredDeviceName.ToString()) : null, "discoveredDeviceName" ,container.Add ); diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/LeafCertificateConfiguration.PowerShell.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/LeafCertificateConfiguration.PowerShell.cs deleted file mode 100644 index 530357b448ab..000000000000 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/LeafCertificateConfiguration.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.DeviceRegistry.Models -{ - using Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.PowerShell; - - /// The leaf certificate configuration. - [System.ComponentModel.TypeConverter(typeof(LeafCertificateConfigurationTypeConverter))] - public partial class LeafCertificateConfiguration - { - - /// - /// 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.DeviceRegistry.Models.ILeafCertificateConfiguration DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new LeafCertificateConfiguration(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.DeviceRegistry.Models.ILeafCertificateConfiguration DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new LeafCertificateConfiguration(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.DeviceRegistry.Models.ILeafCertificateConfiguration FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode.Parse(jsonText)); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal LeafCertificateConfiguration(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("ValidityPeriodInDay")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ILeafCertificateConfigurationInternal)this).ValidityPeriodInDay = (int) content.GetValueForProperty("ValidityPeriodInDay",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ILeafCertificateConfigurationInternal)this).ValidityPeriodInDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal LeafCertificateConfiguration(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("ValidityPeriodInDay")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ILeafCertificateConfigurationInternal)this).ValidityPeriodInDay = (int) content.GetValueForProperty("ValidityPeriodInDay",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ILeafCertificateConfigurationInternal)this).ValidityPeriodInDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); - } - AfterDeserializePSObject(content); - } - - /// Serializes this instance to a json string. - - /// a containing this model serialized to JSON text. - public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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 leaf certificate configuration. - [System.ComponentModel.TypeConverter(typeof(LeafCertificateConfigurationTypeConverter))] - public partial interface ILeafCertificateConfiguration - - { - - } -} \ No newline at end of file diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/LeafCertificateConfiguration.TypeConverter.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/LeafCertificateConfiguration.TypeConverter.cs deleted file mode 100644 index 612e38b4f3b4..000000000000 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/LeafCertificateConfiguration.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.DeviceRegistry.Models -{ - using Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.PowerShell; - - /// - /// A PowerShell PSTypeConverter to support converting to an instance of - /// - public partial class LeafCertificateConfigurationTypeConverter : 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.DeviceRegistry.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Models.ILeafCertificateConfiguration ConvertFrom(dynamic sourceValue) - { - if (null == sourceValue) - { - return null; - } - global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ILeafCertificateConfiguration).IsAssignableFrom(type)) - { - return sourceValue; - } - try - { - return LeafCertificateConfiguration.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; - } - catch - { - // Unable to use JSON pattern - } - if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) - { - return LeafCertificateConfiguration.DeserializeFromPSObject(sourceValue); - } - if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) - { - return LeafCertificateConfiguration.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/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/LeafCertificateConfiguration.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/LeafCertificateConfiguration.cs deleted file mode 100644 index a5486b276fd8..000000000000 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/LeafCertificateConfiguration.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.DeviceRegistry.Models -{ - using static Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Extensions; - - /// The leaf certificate configuration. - public partial class LeafCertificateConfiguration : - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ILeafCertificateConfiguration, - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ILeafCertificateConfigurationInternal - { - - /// Backing field for property. - private int _validityPeriodInDay; - - /// The validity period in days. - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Origin(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.PropertyOrigin.Owned)] - public int ValidityPeriodInDay { get => this._validityPeriodInDay; set => this._validityPeriodInDay = value; } - - /// Creates an new instance. - public LeafCertificateConfiguration() - { - - } - } - /// The leaf certificate configuration. - public partial interface ILeafCertificateConfiguration : - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IJsonSerializable - { - /// The validity period in days. - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Info( - Required = true, - ReadOnly = false, - Read = true, - Create = true, - Update = true, - Description = @"The validity period in days.", - SerializedName = @"validityPeriodInDays", - PossibleTypes = new [] { typeof(int) })] - int ValidityPeriodInDay { get; set; } - - } - /// The leaf certificate configuration. - internal partial interface ILeafCertificateConfigurationInternal - - { - /// The validity period in days. - int ValidityPeriodInDay { get; set; } - - } -} \ No newline at end of file diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/LeafCertificateConfiguration.json.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/LeafCertificateConfiguration.json.cs deleted file mode 100644 index 2907e6ff7845..000000000000 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/LeafCertificateConfiguration.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.DeviceRegistry.Models -{ - using static Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Extensions; - - /// The leaf certificate configuration. - public partial class LeafCertificateConfiguration - { - - /// - /// 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.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.Runtime.Json.JsonObject container, ref bool returnNow); - - /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ILeafCertificateConfiguration. - /// - /// a to deserialize from. - /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ILeafCertificateConfiguration. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ILeafCertificateConfiguration FromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode node) - { - return node is Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonObject json ? new LeafCertificateConfiguration(json) : null; - } - - /// - /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonObject into a new instance of . - /// - /// A Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonObject instance to deserialize from. - internal LeafCertificateConfiguration(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonObject json) - { - bool returnNow = false; - BeforeFromJson(json, ref returnNow); - if (returnNow) - { - return; - } - {_validityPeriodInDay = If( json?.PropertyT("validityPeriodInDays"), out var __jsonValidityPeriodInDays) ? (int)__jsonValidityPeriodInDays : _validityPeriodInDay;} - 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.DeviceRegistry.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode serializationMode) - { - container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonObject(); - - bool returnNow = false; - BeforeToJson(ref container, ref returnNow); - if (returnNow) - { - return container; - } - AddIf( (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNumber(this._validityPeriodInDay), "validityPeriodInDays" ,container.Add ); - AfterToJson(ref container); - return container; - } - } -} \ No newline at end of file diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/LeafCertificateConfigurationUpdate.PowerShell.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/LeafCertificateConfigurationUpdate.PowerShell.cs deleted file mode 100644 index d2ca31c509c8..000000000000 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/LeafCertificateConfigurationUpdate.PowerShell.cs +++ /dev/null @@ -1,168 +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.DeviceRegistry.Models -{ - using Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.PowerShell; - - /// The leaf certificate configuration. - [System.ComponentModel.TypeConverter(typeof(LeafCertificateConfigurationUpdateTypeConverter))] - public partial class LeafCertificateConfigurationUpdate - { - - /// - /// 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.DeviceRegistry.Models.ILeafCertificateConfigurationUpdate DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new LeafCertificateConfigurationUpdate(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.DeviceRegistry.Models.ILeafCertificateConfigurationUpdate DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new LeafCertificateConfigurationUpdate(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.DeviceRegistry.Models.ILeafCertificateConfigurationUpdate FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode.Parse(jsonText)); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal LeafCertificateConfigurationUpdate(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("ValidityPeriodInDay")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ILeafCertificateConfigurationUpdateInternal)this).ValidityPeriodInDay = (int?) content.GetValueForProperty("ValidityPeriodInDay",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ILeafCertificateConfigurationUpdateInternal)this).ValidityPeriodInDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal LeafCertificateConfigurationUpdate(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("ValidityPeriodInDay")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ILeafCertificateConfigurationUpdateInternal)this).ValidityPeriodInDay = (int?) content.GetValueForProperty("ValidityPeriodInDay",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ILeafCertificateConfigurationUpdateInternal)this).ValidityPeriodInDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); - } - AfterDeserializePSObject(content); - } - - /// Serializes this instance to a json string. - - /// a containing this model serialized to JSON text. - public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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 leaf certificate configuration. - [System.ComponentModel.TypeConverter(typeof(LeafCertificateConfigurationUpdateTypeConverter))] - public partial interface ILeafCertificateConfigurationUpdate - - { - - } -} \ No newline at end of file diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/LeafCertificateConfigurationUpdate.TypeConverter.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/LeafCertificateConfigurationUpdate.TypeConverter.cs deleted file mode 100644 index ce1d8c51992d..000000000000 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/LeafCertificateConfigurationUpdate.TypeConverter.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.DeviceRegistry.Models -{ - using Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.PowerShell; - - /// - /// A PowerShell PSTypeConverter to support converting to an instance of - /// - public partial class LeafCertificateConfigurationUpdateTypeConverter : 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.DeviceRegistry.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Models.ILeafCertificateConfigurationUpdate ConvertFrom(dynamic sourceValue) - { - if (null == sourceValue) - { - return null; - } - global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ILeafCertificateConfigurationUpdate).IsAssignableFrom(type)) - { - return sourceValue; - } - try - { - return LeafCertificateConfigurationUpdate.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; - } - catch - { - // Unable to use JSON pattern - } - if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) - { - return LeafCertificateConfigurationUpdate.DeserializeFromPSObject(sourceValue); - } - if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) - { - return LeafCertificateConfigurationUpdate.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/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/LeafCertificateConfigurationUpdate.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/LeafCertificateConfigurationUpdate.cs deleted file mode 100644 index 5554806e6f57..000000000000 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/LeafCertificateConfigurationUpdate.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.DeviceRegistry.Models -{ - using static Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Extensions; - - /// The leaf certificate configuration. - public partial class LeafCertificateConfigurationUpdate : - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ILeafCertificateConfigurationUpdate, - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ILeafCertificateConfigurationUpdateInternal - { - - /// Backing field for property. - private int? _validityPeriodInDay; - - /// The validity period in days. - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Origin(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.PropertyOrigin.Owned)] - public int? ValidityPeriodInDay { get => this._validityPeriodInDay; set => this._validityPeriodInDay = value; } - - /// Creates an new instance. - public LeafCertificateConfigurationUpdate() - { - - } - } - /// The leaf certificate configuration. - public partial interface ILeafCertificateConfigurationUpdate : - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IJsonSerializable - { - /// The validity period in days. - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Info( - Required = false, - ReadOnly = false, - Read = true, - Create = true, - Update = true, - Description = @"The validity period in days.", - SerializedName = @"validityPeriodInDays", - PossibleTypes = new [] { typeof(int) })] - int? ValidityPeriodInDay { get; set; } - - } - /// The leaf certificate configuration. - internal partial interface ILeafCertificateConfigurationUpdateInternal - - { - /// The validity period in days. - int? ValidityPeriodInDay { get; set; } - - } -} \ No newline at end of file diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/LeafCertificateConfigurationUpdate.json.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/LeafCertificateConfigurationUpdate.json.cs deleted file mode 100644 index 37fc733dc1e8..000000000000 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/LeafCertificateConfigurationUpdate.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.DeviceRegistry.Models -{ - using static Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Extensions; - - /// The leaf certificate configuration. - public partial class LeafCertificateConfigurationUpdate - { - - /// - /// 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.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.Runtime.Json.JsonObject container, ref bool returnNow); - - /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ILeafCertificateConfigurationUpdate. - /// - /// a to deserialize from. - /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ILeafCertificateConfigurationUpdate. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ILeafCertificateConfigurationUpdate FromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode node) - { - return node is Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonObject json ? new LeafCertificateConfigurationUpdate(json) : null; - } - - /// - /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonObject into a new instance of . - /// - /// A Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonObject instance to deserialize from. - internal LeafCertificateConfigurationUpdate(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonObject json) - { - bool returnNow = false; - BeforeFromJson(json, ref returnNow); - if (returnNow) - { - return; - } - {_validityPeriodInDay = If( json?.PropertyT("validityPeriodInDays"), out var __jsonValidityPeriodInDays) ? (int?)__jsonValidityPeriodInDays : _validityPeriodInDay;} - 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.DeviceRegistry.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode serializationMode) - { - container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonObject(); - - bool returnNow = false; - BeforeToJson(ref container, ref returnNow); - if (returnNow) - { - return container; - } - AddIf( null != this._validityPeriodInDay ? (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNumber((int)this._validityPeriodInDay) : null, "validityPeriodInDays" ,container.Add ); - AfterToJson(ref container); - return container; - } - } -} \ No newline at end of file diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/NamespaceDevice.PowerShell.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/NamespaceDevice.PowerShell.cs index 00eb865ef194..388fd4997087 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/NamespaceDevice.PowerShell.cs +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/NamespaceDevice.PowerShell.cs @@ -189,10 +189,6 @@ internal NamespaceDevice(global::System.Collections.IDictionary content) { ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDeviceInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IDeviceStatus) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDeviceInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.DeviceStatusTypeConverter.ConvertFrom); } - if (content.Contains("Policy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDeviceInternal)this).Policy = (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IDeviceCredentialPolicy) content.GetValueForProperty("Policy",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDeviceInternal)this).Policy, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.DeviceCredentialPolicyTypeConverter.ConvertFrom); - } if (content.Contains("Uuid")) { ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDeviceInternal)this).Uuid = (string) content.GetValueForProperty("Uuid",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDeviceInternal)this).Uuid, global::System.Convert.ToString); @@ -257,10 +253,6 @@ internal NamespaceDevice(global::System.Collections.IDictionary content) { ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDeviceInternal)this).ConfigVersion = (long?) content.GetValueForProperty("ConfigVersion",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDeviceInternal)this).ConfigVersion, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); } - if (content.Contains("PolicyResourceId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDeviceInternal)this).PolicyResourceId = (string) content.GetValueForProperty("PolicyResourceId",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDeviceInternal)this).PolicyResourceId, global::System.Convert.ToString); - } if (content.Contains("OutboundAssigned")) { ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDeviceInternal)this).OutboundAssigned = (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IOutboundEndpointsAssigned) content.GetValueForProperty("OutboundAssigned",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDeviceInternal)this).OutboundAssigned, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.OutboundEndpointsAssignedTypeConverter.ConvertFrom); @@ -390,10 +382,6 @@ internal NamespaceDevice(global::System.Management.Automation.PSObject content) { ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDeviceInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IDeviceStatus) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDeviceInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.DeviceStatusTypeConverter.ConvertFrom); } - if (content.Contains("Policy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDeviceInternal)this).Policy = (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IDeviceCredentialPolicy) content.GetValueForProperty("Policy",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDeviceInternal)this).Policy, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.DeviceCredentialPolicyTypeConverter.ConvertFrom); - } if (content.Contains("Uuid")) { ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDeviceInternal)this).Uuid = (string) content.GetValueForProperty("Uuid",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDeviceInternal)this).Uuid, global::System.Convert.ToString); @@ -458,10 +446,6 @@ internal NamespaceDevice(global::System.Management.Automation.PSObject content) { ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDeviceInternal)this).ConfigVersion = (long?) content.GetValueForProperty("ConfigVersion",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDeviceInternal)this).ConfigVersion, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); } - if (content.Contains("PolicyResourceId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDeviceInternal)this).PolicyResourceId = (string) content.GetValueForProperty("PolicyResourceId",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDeviceInternal)this).PolicyResourceId, global::System.Convert.ToString); - } if (content.Contains("OutboundAssigned")) { ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDeviceInternal)this).OutboundAssigned = (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IOutboundEndpointsAssigned) content.GetValueForProperty("OutboundAssigned",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDeviceInternal)this).OutboundAssigned, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.OutboundEndpointsAssignedTypeConverter.ConvertFrom); diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/NamespaceDevice.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/NamespaceDevice.cs index 0c2b0af9e800..d9aec988cef2 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/NamespaceDevice.cs +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/NamespaceDevice.cs @@ -144,9 +144,6 @@ public partial class NamespaceDevice : /// Internal Acessors for Message string Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDeviceInternal.Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDevicePropertiesInternal)Property).Message; set => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDevicePropertiesInternal)Property).Message = value ?? null; } - /// Internal Acessors for Policy - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IDeviceCredentialPolicy Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDeviceInternal.Policy { get => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDevicePropertiesInternal)Property).Policy; set => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDevicePropertiesInternal)Property).Policy = value ?? null /* model class */; } - /// Internal Acessors for Property Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDeviceProperties Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDeviceInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.NamespaceDeviceProperties()); set { {_property = value;} } } @@ -225,10 +222,6 @@ public partial class NamespaceDevice : [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Origin(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.PropertyOrigin.Inlined)] public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IOutboundEndpointsUnassigned OutboundUnassigned { get => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDevicePropertiesInternal)Property).OutboundUnassigned; set => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDevicePropertiesInternal)Property).OutboundUnassigned = value ?? null /* model class */; } - /// Resource Id of the Policy. - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Origin(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.PropertyOrigin.Inlined)] - public string PolicyResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDevicePropertiesInternal)Property).PolicyResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDevicePropertiesInternal)Property).PolicyResourceId = value ?? null; } - /// Backing field for property. private Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDeviceProperties _property; @@ -551,17 +544,6 @@ public partial interface INamespaceDevice : SerializedName = @"unassigned", PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IOutboundEndpointsUnassigned) })] Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IOutboundEndpointsUnassigned OutboundUnassigned { get; set; } - /// Resource Id of the Policy. - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Info( - Required = false, - ReadOnly = false, - Read = true, - Create = true, - Update = true, - Description = @"Resource Id of the Policy.", - SerializedName = @"resourceId", - PossibleTypes = new [] { typeof(string) })] - string PolicyResourceId { get; set; } /// Provisioning state of the resource. [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Info( Required = false, @@ -673,10 +655,6 @@ internal partial interface INamespaceDeviceInternal : Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IOutboundEndpointsAssigned OutboundAssigned { get; set; } /// Set of most recently removed endpoints. Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IOutboundEndpointsUnassigned OutboundUnassigned { get; set; } - /// Policy used to issue device certificates. - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IDeviceCredentialPolicy Policy { get; set; } - /// Resource Id of the Policy. - string PolicyResourceId { get; set; } /// The resource-specific properties for this resource. Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDeviceProperties Property { get; set; } /// Provisioning state of the resource. diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/NamespaceDeviceProperties.PowerShell.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/NamespaceDeviceProperties.PowerShell.cs index cc61bb01790d..7044eff370a1 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/NamespaceDeviceProperties.PowerShell.cs +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/NamespaceDeviceProperties.PowerShell.cs @@ -117,10 +117,6 @@ internal NamespaceDeviceProperties(global::System.Collections.IDictionary conten { ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDevicePropertiesInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IDeviceStatus) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDevicePropertiesInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.DeviceStatusTypeConverter.ConvertFrom); } - if (content.Contains("Policy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDevicePropertiesInternal)this).Policy = (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IDeviceCredentialPolicy) content.GetValueForProperty("Policy",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDevicePropertiesInternal)this).Policy, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.DeviceCredentialPolicyTypeConverter.ConvertFrom); - } if (content.Contains("Uuid")) { ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDevicePropertiesInternal)this).Uuid = (string) content.GetValueForProperty("Uuid",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDevicePropertiesInternal)this).Uuid, global::System.Convert.ToString); @@ -189,10 +185,6 @@ internal NamespaceDeviceProperties(global::System.Collections.IDictionary conten { ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDevicePropertiesInternal)this).ConfigVersion = (long?) content.GetValueForProperty("ConfigVersion",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDevicePropertiesInternal)this).ConfigVersion, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); } - if (content.Contains("PolicyResourceId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDevicePropertiesInternal)this).PolicyResourceId = (string) content.GetValueForProperty("PolicyResourceId",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDevicePropertiesInternal)this).PolicyResourceId, global::System.Convert.ToString); - } if (content.Contains("OutboundAssigned")) { ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDevicePropertiesInternal)this).OutboundAssigned = (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IOutboundEndpointsAssigned) content.GetValueForProperty("OutboundAssigned",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDevicePropertiesInternal)this).OutboundAssigned, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.OutboundEndpointsAssignedTypeConverter.ConvertFrom); @@ -250,10 +242,6 @@ internal NamespaceDeviceProperties(global::System.Management.Automation.PSObject { ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDevicePropertiesInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IDeviceStatus) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDevicePropertiesInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.DeviceStatusTypeConverter.ConvertFrom); } - if (content.Contains("Policy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDevicePropertiesInternal)this).Policy = (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IDeviceCredentialPolicy) content.GetValueForProperty("Policy",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDevicePropertiesInternal)this).Policy, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.DeviceCredentialPolicyTypeConverter.ConvertFrom); - } if (content.Contains("Uuid")) { ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDevicePropertiesInternal)this).Uuid = (string) content.GetValueForProperty("Uuid",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDevicePropertiesInternal)this).Uuid, global::System.Convert.ToString); @@ -322,10 +310,6 @@ internal NamespaceDeviceProperties(global::System.Management.Automation.PSObject { ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDevicePropertiesInternal)this).ConfigVersion = (long?) content.GetValueForProperty("ConfigVersion",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDevicePropertiesInternal)this).ConfigVersion, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); } - if (content.Contains("PolicyResourceId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDevicePropertiesInternal)this).PolicyResourceId = (string) content.GetValueForProperty("PolicyResourceId",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDevicePropertiesInternal)this).PolicyResourceId, global::System.Convert.ToString); - } if (content.Contains("OutboundAssigned")) { ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDevicePropertiesInternal)this).OutboundAssigned = (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IOutboundEndpointsAssigned) content.GetValueForProperty("OutboundAssigned",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDevicePropertiesInternal)this).OutboundAssigned, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.OutboundEndpointsAssignedTypeConverter.ConvertFrom); diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/NamespaceDeviceProperties.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/NamespaceDeviceProperties.cs index b16cf5ccb670..c80245528178 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/NamespaceDeviceProperties.cs +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/NamespaceDeviceProperties.cs @@ -125,9 +125,6 @@ public partial class NamespaceDeviceProperties : /// Internal Acessors for Message string Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDevicePropertiesInternal.Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IDeviceStatusInternal)Status).Message; set => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IDeviceStatusInternal)Status).Message = value ?? null; } - /// Internal Acessors for Policy - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IDeviceCredentialPolicy Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDevicePropertiesInternal.Policy { get => (this._policy = this._policy ?? new Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.DeviceCredentialPolicy()); set { {_policy = value;} } } - /// Internal Acessors for ProvisioningState string Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDevicePropertiesInternal.ProvisioningState { get => this._provisioningState; set { {_provisioningState = value;} } } @@ -178,17 +175,6 @@ public partial class NamespaceDeviceProperties : [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Origin(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.PropertyOrigin.Inlined)] public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IOutboundEndpointsUnassigned OutboundUnassigned { get => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IMessagingEndpoints1Internal)Endpoint).OutboundUnassigned; set => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IMessagingEndpoints1Internal)Endpoint).OutboundUnassigned = value ?? null /* model class */; } - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IDeviceCredentialPolicy _policy; - - /// Policy used to issue device certificates. - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Origin(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IDeviceCredentialPolicy Policy { get => (this._policy = this._policy ?? new Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.DeviceCredentialPolicy()); set => this._policy = value; } - - /// Resource Id of the Policy. - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Origin(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.PropertyOrigin.Inlined)] - public string PolicyResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IDeviceCredentialPolicyInternal)Policy).ResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IDeviceCredentialPolicyInternal)Policy).ResourceId = value ?? null; } - /// Backing field for property. private string _provisioningState; @@ -430,17 +416,6 @@ public partial interface INamespaceDeviceProperties : SerializedName = @"unassigned", PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IOutboundEndpointsUnassigned) })] Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IOutboundEndpointsUnassigned OutboundUnassigned { get; set; } - /// Resource Id of the Policy. - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Info( - Required = false, - ReadOnly = false, - Read = true, - Create = true, - Update = true, - Description = @"Resource Id of the Policy.", - SerializedName = @"resourceId", - PossibleTypes = new [] { typeof(string) })] - string PolicyResourceId { get; set; } /// Provisioning state of the resource. [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Info( Required = false, @@ -544,10 +519,6 @@ internal partial interface INamespaceDevicePropertiesInternal Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IOutboundEndpointsAssigned OutboundAssigned { get; set; } /// Set of most recently removed endpoints. Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IOutboundEndpointsUnassigned OutboundUnassigned { get; set; } - /// Policy used to issue device certificates. - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IDeviceCredentialPolicy Policy { get; set; } - /// Resource Id of the Policy. - string PolicyResourceId { get; set; } /// Provisioning state of the resource. [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.PSArgumentCompleterAttribute("Succeeded", "Failed", "Canceled", "Accepted", "Deleting")] string ProvisioningState { get; set; } diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/NamespaceDeviceProperties.json.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/NamespaceDeviceProperties.json.cs index 99a8011da45f..9a8ee47a4e7f 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/NamespaceDeviceProperties.json.cs +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/NamespaceDeviceProperties.json.cs @@ -79,7 +79,6 @@ internal NamespaceDeviceProperties(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegi } {_endpoint = If( json?.PropertyT("endpoints"), out var __jsonEndpoints) ? Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.MessagingEndpoints1.FromJson(__jsonEndpoints) : _endpoint;} {_status = If( json?.PropertyT("status"), out var __jsonStatus) ? Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.DeviceStatus.FromJson(__jsonStatus) : _status;} - {_policy = If( json?.PropertyT("policy"), out var __jsonPolicy) ? Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.DeviceCredentialPolicy.FromJson(__jsonPolicy) : _policy;} {_uuid = If( json?.PropertyT("uuid"), out var __jsonUuid) ? (string)__jsonUuid : (string)_uuid;} {_enabled = If( json?.PropertyT("enabled"), out var __jsonEnabled) ? (bool?)__jsonEnabled : _enabled;} {_externalDeviceId = If( json?.PropertyT("externalDeviceId"), out var __jsonExternalDeviceId) ? (string)__jsonExternalDeviceId : (string)_externalDeviceId;} @@ -119,7 +118,6 @@ public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode T { AddIf( null != this._status ? (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode) this._status.ToJson(null,serializationMode) : null, "status" ,container.Add ); } - AddIf( null != this._policy ? (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode) this._policy.ToJson(null,serializationMode) : null, "policy" ,container.Add ); if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._uuid)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonString(this._uuid.ToString()) : null, "uuid" ,container.Add ); diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/NamespaceDeviceUpdate.PowerShell.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/NamespaceDeviceUpdate.PowerShell.cs index fd87c486cbcd..99d2e5601c3b 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/NamespaceDeviceUpdate.PowerShell.cs +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/NamespaceDeviceUpdate.PowerShell.cs @@ -121,10 +121,6 @@ internal NamespaceDeviceUpdate(global::System.Collections.IDictionary content) { ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDeviceUpdateInternal)this).Endpoint = (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IMessagingEndpointsUpdate) content.GetValueForProperty("Endpoint",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDeviceUpdateInternal)this).Endpoint, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.MessagingEndpointsUpdateTypeConverter.ConvertFrom); } - if (content.Contains("Policy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDeviceUpdateInternal)this).Policy = (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IDeviceCredentialPolicy) content.GetValueForProperty("Policy",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDeviceUpdateInternal)this).Policy, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.DeviceCredentialPolicyTypeConverter.ConvertFrom); - } if (content.Contains("OperatingSystemVersion")) { ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDeviceUpdateInternal)this).OperatingSystemVersion = (string) content.GetValueForProperty("OperatingSystemVersion",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDeviceUpdateInternal)this).OperatingSystemVersion, global::System.Convert.ToString); @@ -145,10 +141,6 @@ internal NamespaceDeviceUpdate(global::System.Collections.IDictionary content) { ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDeviceUpdateInternal)this).EndpointInbound = (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IMessagingEndpointsUpdateInbound) content.GetValueForProperty("EndpointInbound",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDeviceUpdateInternal)this).EndpointInbound, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.MessagingEndpointsUpdateInboundTypeConverter.ConvertFrom); } - if (content.Contains("PolicyResourceId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDeviceUpdateInternal)this).PolicyResourceId = (string) content.GetValueForProperty("PolicyResourceId",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDeviceUpdateInternal)this).PolicyResourceId, global::System.Convert.ToString); - } if (content.Contains("OutboundAssigned")) { ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDeviceUpdateInternal)this).OutboundAssigned = (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IOutboundEndpointsUpdateAssigned) content.GetValueForProperty("OutboundAssigned",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDeviceUpdateInternal)this).OutboundAssigned, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.OutboundEndpointsUpdateAssignedTypeConverter.ConvertFrom); @@ -186,10 +178,6 @@ internal NamespaceDeviceUpdate(global::System.Management.Automation.PSObject con { ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDeviceUpdateInternal)this).Endpoint = (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IMessagingEndpointsUpdate) content.GetValueForProperty("Endpoint",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDeviceUpdateInternal)this).Endpoint, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.MessagingEndpointsUpdateTypeConverter.ConvertFrom); } - if (content.Contains("Policy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDeviceUpdateInternal)this).Policy = (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IDeviceCredentialPolicy) content.GetValueForProperty("Policy",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDeviceUpdateInternal)this).Policy, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.DeviceCredentialPolicyTypeConverter.ConvertFrom); - } if (content.Contains("OperatingSystemVersion")) { ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDeviceUpdateInternal)this).OperatingSystemVersion = (string) content.GetValueForProperty("OperatingSystemVersion",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDeviceUpdateInternal)this).OperatingSystemVersion, global::System.Convert.ToString); @@ -210,10 +198,6 @@ internal NamespaceDeviceUpdate(global::System.Management.Automation.PSObject con { ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDeviceUpdateInternal)this).EndpointInbound = (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IMessagingEndpointsUpdateInbound) content.GetValueForProperty("EndpointInbound",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDeviceUpdateInternal)this).EndpointInbound, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.MessagingEndpointsUpdateInboundTypeConverter.ConvertFrom); } - if (content.Contains("PolicyResourceId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDeviceUpdateInternal)this).PolicyResourceId = (string) content.GetValueForProperty("PolicyResourceId",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDeviceUpdateInternal)this).PolicyResourceId, global::System.Convert.ToString); - } if (content.Contains("OutboundAssigned")) { ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDeviceUpdateInternal)this).OutboundAssigned = (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IOutboundEndpointsUpdateAssigned) content.GetValueForProperty("OutboundAssigned",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDeviceUpdateInternal)this).OutboundAssigned, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.OutboundEndpointsUpdateAssignedTypeConverter.ConvertFrom); diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/NamespaceDeviceUpdate.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/NamespaceDeviceUpdate.cs index 37f202f330ca..8ddbee426ae1 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/NamespaceDeviceUpdate.cs +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/NamespaceDeviceUpdate.cs @@ -34,9 +34,6 @@ public partial class NamespaceDeviceUpdate : /// Internal Acessors for EndpointOutbound Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IOutboundEndpointsUpdate Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDeviceUpdateInternal.EndpointOutbound { get => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDeviceUpdatePropertiesInternal)Property).EndpointOutbound; set => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDeviceUpdatePropertiesInternal)Property).EndpointOutbound = value ?? null /* model class */; } - /// Internal Acessors for Policy - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IDeviceCredentialPolicy Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDeviceUpdateInternal.Policy { get => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDeviceUpdatePropertiesInternal)Property).Policy; set => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDeviceUpdatePropertiesInternal)Property).Policy = value ?? null /* model class */; } - /// Internal Acessors for Property Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDeviceUpdateProperties Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDeviceUpdateInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.NamespaceDeviceUpdateProperties()); set { {_property = value;} } } @@ -52,10 +49,6 @@ public partial class NamespaceDeviceUpdate : [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Origin(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.PropertyOrigin.Inlined)] public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IOutboundEndpointsUpdateUnassigned OutboundUnassigned { get => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDeviceUpdatePropertiesInternal)Property).OutboundUnassigned; set => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDeviceUpdatePropertiesInternal)Property).OutboundUnassigned = value ?? null /* model class */; } - /// Resource Id of the Policy. - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Origin(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.PropertyOrigin.Inlined)] - public string PolicyResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDeviceUpdatePropertiesInternal)Property).PolicyResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDeviceUpdatePropertiesInternal)Property).PolicyResourceId = value ?? null; } - /// Backing field for property. private Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDeviceUpdateProperties _property; @@ -149,17 +142,6 @@ public partial interface INamespaceDeviceUpdate : SerializedName = @"unassigned", PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IOutboundEndpointsUpdateUnassigned) })] Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IOutboundEndpointsUpdateUnassigned OutboundUnassigned { get; set; } - /// Resource Id of the Policy. - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Info( - Required = false, - ReadOnly = false, - Read = true, - Create = true, - Update = true, - Description = @"Resource Id of the Policy.", - SerializedName = @"resourceId", - PossibleTypes = new [] { typeof(string) })] - string PolicyResourceId { get; set; } /// Resource tags. [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Info( Required = false, @@ -196,10 +178,6 @@ internal partial interface INamespaceDeviceUpdateInternal Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IOutboundEndpointsUpdateAssigned OutboundAssigned { get; set; } /// Set of most recently removed endpoints. Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IOutboundEndpointsUpdateUnassigned OutboundUnassigned { get; set; } - /// Policy used to issue device certificates. - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IDeviceCredentialPolicy Policy { get; set; } - /// Resource Id of the Policy. - string PolicyResourceId { get; set; } /// The resource-specific properties for this resource. Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDeviceUpdateProperties Property { get; set; } /// Resource tags. diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/NamespaceDeviceUpdateProperties.PowerShell.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/NamespaceDeviceUpdateProperties.PowerShell.cs index f36c2a969198..ac8b344a7665 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/NamespaceDeviceUpdateProperties.PowerShell.cs +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/NamespaceDeviceUpdateProperties.PowerShell.cs @@ -113,10 +113,6 @@ internal NamespaceDeviceUpdateProperties(global::System.Collections.IDictionary { ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDeviceUpdatePropertiesInternal)this).Endpoint = (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IMessagingEndpointsUpdate) content.GetValueForProperty("Endpoint",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDeviceUpdatePropertiesInternal)this).Endpoint, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.MessagingEndpointsUpdateTypeConverter.ConvertFrom); } - if (content.Contains("Policy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDeviceUpdatePropertiesInternal)this).Policy = (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IDeviceCredentialPolicy) content.GetValueForProperty("Policy",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDeviceUpdatePropertiesInternal)this).Policy, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.DeviceCredentialPolicyTypeConverter.ConvertFrom); - } if (content.Contains("OperatingSystemVersion")) { ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDeviceUpdatePropertiesInternal)this).OperatingSystemVersion = (string) content.GetValueForProperty("OperatingSystemVersion",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDeviceUpdatePropertiesInternal)this).OperatingSystemVersion, global::System.Convert.ToString); @@ -137,10 +133,6 @@ internal NamespaceDeviceUpdateProperties(global::System.Collections.IDictionary { ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDeviceUpdatePropertiesInternal)this).EndpointInbound = (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IMessagingEndpointsUpdateInbound) content.GetValueForProperty("EndpointInbound",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDeviceUpdatePropertiesInternal)this).EndpointInbound, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.MessagingEndpointsUpdateInboundTypeConverter.ConvertFrom); } - if (content.Contains("PolicyResourceId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDeviceUpdatePropertiesInternal)this).PolicyResourceId = (string) content.GetValueForProperty("PolicyResourceId",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDeviceUpdatePropertiesInternal)this).PolicyResourceId, global::System.Convert.ToString); - } if (content.Contains("OutboundAssigned")) { ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDeviceUpdatePropertiesInternal)this).OutboundAssigned = (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IOutboundEndpointsUpdateAssigned) content.GetValueForProperty("OutboundAssigned",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDeviceUpdatePropertiesInternal)this).OutboundAssigned, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.OutboundEndpointsUpdateAssignedTypeConverter.ConvertFrom); @@ -170,10 +162,6 @@ internal NamespaceDeviceUpdateProperties(global::System.Management.Automation.PS { ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDeviceUpdatePropertiesInternal)this).Endpoint = (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IMessagingEndpointsUpdate) content.GetValueForProperty("Endpoint",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDeviceUpdatePropertiesInternal)this).Endpoint, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.MessagingEndpointsUpdateTypeConverter.ConvertFrom); } - if (content.Contains("Policy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDeviceUpdatePropertiesInternal)this).Policy = (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IDeviceCredentialPolicy) content.GetValueForProperty("Policy",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDeviceUpdatePropertiesInternal)this).Policy, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.DeviceCredentialPolicyTypeConverter.ConvertFrom); - } if (content.Contains("OperatingSystemVersion")) { ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDeviceUpdatePropertiesInternal)this).OperatingSystemVersion = (string) content.GetValueForProperty("OperatingSystemVersion",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDeviceUpdatePropertiesInternal)this).OperatingSystemVersion, global::System.Convert.ToString); @@ -194,10 +182,6 @@ internal NamespaceDeviceUpdateProperties(global::System.Management.Automation.PS { ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDeviceUpdatePropertiesInternal)this).EndpointInbound = (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IMessagingEndpointsUpdateInbound) content.GetValueForProperty("EndpointInbound",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDeviceUpdatePropertiesInternal)this).EndpointInbound, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.MessagingEndpointsUpdateInboundTypeConverter.ConvertFrom); } - if (content.Contains("PolicyResourceId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDeviceUpdatePropertiesInternal)this).PolicyResourceId = (string) content.GetValueForProperty("PolicyResourceId",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDeviceUpdatePropertiesInternal)this).PolicyResourceId, global::System.Convert.ToString); - } if (content.Contains("OutboundAssigned")) { ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDeviceUpdatePropertiesInternal)this).OutboundAssigned = (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IOutboundEndpointsUpdateAssigned) content.GetValueForProperty("OutboundAssigned",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDeviceUpdatePropertiesInternal)this).OutboundAssigned, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.OutboundEndpointsUpdateAssignedTypeConverter.ConvertFrom); diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/NamespaceDeviceUpdateProperties.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/NamespaceDeviceUpdateProperties.cs index 573508a68e5b..d54a99fde742 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/NamespaceDeviceUpdateProperties.cs +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/NamespaceDeviceUpdateProperties.cs @@ -47,9 +47,6 @@ public partial class NamespaceDeviceUpdateProperties : /// Internal Acessors for EndpointOutbound Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IOutboundEndpointsUpdate Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDeviceUpdatePropertiesInternal.EndpointOutbound { get => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IMessagingEndpointsUpdateInternal)Endpoint).Outbound; set => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IMessagingEndpointsUpdateInternal)Endpoint).Outbound = value ?? null /* model class */; } - /// Internal Acessors for Policy - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IDeviceCredentialPolicy Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDeviceUpdatePropertiesInternal.Policy { get => (this._policy = this._policy ?? new Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.DeviceCredentialPolicy()); set { {_policy = value;} } } - /// Backing field for property. private string _operatingSystemVersion; @@ -65,17 +62,6 @@ public partial class NamespaceDeviceUpdateProperties : [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Origin(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.PropertyOrigin.Inlined)] public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IOutboundEndpointsUpdateUnassigned OutboundUnassigned { get => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IMessagingEndpointsUpdateInternal)Endpoint).OutboundUnassigned; set => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IMessagingEndpointsUpdateInternal)Endpoint).OutboundUnassigned = value ?? null /* model class */; } - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IDeviceCredentialPolicy _policy; - - /// Policy used to issue device certificates. - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Origin(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IDeviceCredentialPolicy Policy { get => (this._policy = this._policy ?? new Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.DeviceCredentialPolicy()); set => this._policy = value; } - - /// Resource Id of the Policy. - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Origin(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.PropertyOrigin.Inlined)] - public string PolicyResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IDeviceCredentialPolicyInternal)Policy).ResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IDeviceCredentialPolicyInternal)Policy).ResourceId = value ?? null; } - /// Creates an new instance. public NamespaceDeviceUpdateProperties() { @@ -155,17 +141,6 @@ public partial interface INamespaceDeviceUpdateProperties : SerializedName = @"unassigned", PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IOutboundEndpointsUpdateUnassigned) })] Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IOutboundEndpointsUpdateUnassigned OutboundUnassigned { get; set; } - /// Resource Id of the Policy. - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Info( - Required = false, - ReadOnly = false, - Read = true, - Create = true, - Update = true, - Description = @"Resource Id of the Policy.", - SerializedName = @"resourceId", - PossibleTypes = new [] { typeof(string) })] - string PolicyResourceId { get; set; } } /// The updatable properties of the NamespaceDevice. @@ -191,10 +166,6 @@ internal partial interface INamespaceDeviceUpdatePropertiesInternal Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IOutboundEndpointsUpdateAssigned OutboundAssigned { get; set; } /// Set of most recently removed endpoints. Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IOutboundEndpointsUpdateUnassigned OutboundUnassigned { get; set; } - /// Policy used to issue device certificates. - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IDeviceCredentialPolicy Policy { get; set; } - /// Resource Id of the Policy. - string PolicyResourceId { get; set; } } } \ No newline at end of file diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/NamespaceDeviceUpdateProperties.json.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/NamespaceDeviceUpdateProperties.json.cs index e8ca16931163..ddc188b32ef0 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/NamespaceDeviceUpdateProperties.json.cs +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/NamespaceDeviceUpdateProperties.json.cs @@ -78,7 +78,6 @@ internal NamespaceDeviceUpdateProperties(Microsoft.Azure.PowerShell.Cmdlets.Devi return; } {_endpoint = If( json?.PropertyT("endpoints"), out var __jsonEndpoints) ? Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.MessagingEndpointsUpdate.FromJson(__jsonEndpoints) : _endpoint;} - {_policy = If( json?.PropertyT("policy"), out var __jsonPolicy) ? Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.DeviceCredentialPolicy.FromJson(__jsonPolicy) : _policy;} {_operatingSystemVersion = If( json?.PropertyT("operatingSystemVersion"), out var __jsonOperatingSystemVersion) ? (string)__jsonOperatingSystemVersion : (string)_operatingSystemVersion;} {_attribute = If( json?.PropertyT("attributes"), out var __jsonAttributes) ? Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.NamespaceDeviceUpdatePropertiesAttributes.FromJson(__jsonAttributes) : _attribute;} {_enabled = If( json?.PropertyT("enabled"), out var __jsonEnabled) ? (bool?)__jsonEnabled : _enabled;} @@ -105,7 +104,6 @@ public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode T return container; } AddIf( null != this._endpoint ? (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode) this._endpoint.ToJson(null,serializationMode) : null, "endpoints" ,container.Add ); - AddIf( null != this._policy ? (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode) this._policy.ToJson(null,serializationMode) : null, "policy" ,container.Add ); AddIf( null != (((object)this._operatingSystemVersion)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonString(this._operatingSystemVersion.ToString()) : null, "operatingSystemVersion" ,container.Add ); AddIf( null != this._attribute ? (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode) this._attribute.ToJson(null,serializationMode) : null, "attributes" ,container.Add ); AddIf( null != this._enabled ? (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonBoolean((bool)this._enabled) : null, "enabled" ,container.Add ); diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/Policy.PowerShell.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/Policy.PowerShell.cs deleted file mode 100644 index 6b2e238798c4..000000000000 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/Policy.PowerShell.cs +++ /dev/null @@ -1,332 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models -{ - using Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.PowerShell; - - /// A Credential Policy - [System.ComponentModel.TypeConverter(typeof(PolicyTypeConverter))] - public partial class Policy - { - - /// - /// 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.DeviceRegistry.Models.IPolicy DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new Policy(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.DeviceRegistry.Models.IPolicy DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new Policy(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.DeviceRegistry.Models.IPolicy FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode.Parse(jsonText)); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal Policy(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.DeviceRegistry.Models.IPolicyInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.PolicyPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("SystemDataCreatedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataCreatedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Models.IResourceInternal)this).SystemDataCreatedByType = (string) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IResourceInternal)this).SystemDataCreatedByType, global::System.Convert.ToString); - } - if (content.Contains("SystemDataLastModifiedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataLastModifiedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IResourceInternal)this).SystemDataLastModifiedByType = (string) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IResourceInternal)this).SystemDataLastModifiedByType, global::System.Convert.ToString); - } - if (content.Contains("SystemDataLastModifiedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Models.IResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.SystemDataTypeConverter.ConvertFrom); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IResourceInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IResourceInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IResourceInternal)this).Type, global::System.Convert.ToString); - } - if (content.Contains("Tag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.TrackedResourceTagsTypeConverter.ConvertFrom); - } - if (content.Contains("Location")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ITrackedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ITrackedResourceInternal)this).Location, global::System.Convert.ToString); - } - if (content.Contains("ProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyInternal)this).ProvisioningState, global::System.Convert.ToString); - } - if (content.Contains("Certificate")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyInternal)this).Certificate = (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICertificateConfiguration) content.GetValueForProperty("Certificate",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyInternal)this).Certificate, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.CertificateConfigurationTypeConverter.ConvertFrom); - } - if (content.Contains("CertificateAuthorityConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyInternal)this).CertificateAuthorityConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICertificateAuthorityConfiguration) content.GetValueForProperty("CertificateAuthorityConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyInternal)this).CertificateAuthorityConfiguration, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.CertificateAuthorityConfigurationTypeConverter.ConvertFrom); - } - if (content.Contains("CertificateLeafCertificateConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyInternal)this).CertificateLeafCertificateConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ILeafCertificateConfiguration) content.GetValueForProperty("CertificateLeafCertificateConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyInternal)this).CertificateLeafCertificateConfiguration, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.LeafCertificateConfigurationTypeConverter.ConvertFrom); - } - if (content.Contains("CertificateAuthorityConfigurationSubject")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyInternal)this).CertificateAuthorityConfigurationSubject = (string) content.GetValueForProperty("CertificateAuthorityConfigurationSubject",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyInternal)this).CertificateAuthorityConfigurationSubject, global::System.Convert.ToString); - } - if (content.Contains("CertificateAuthorityConfigurationKeyType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyInternal)this).CertificateAuthorityConfigurationKeyType = (string) content.GetValueForProperty("CertificateAuthorityConfigurationKeyType",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyInternal)this).CertificateAuthorityConfigurationKeyType, global::System.Convert.ToString); - } - if (content.Contains("CertificateAuthorityConfigurationValidityNotBefore")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyInternal)this).CertificateAuthorityConfigurationValidityNotBefore = (global::System.DateTime?) content.GetValueForProperty("CertificateAuthorityConfigurationValidityNotBefore",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyInternal)this).CertificateAuthorityConfigurationValidityNotBefore, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("CertificateAuthorityConfigurationValidityNotAfter")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyInternal)this).CertificateAuthorityConfigurationValidityNotAfter = (global::System.DateTime?) content.GetValueForProperty("CertificateAuthorityConfigurationValidityNotAfter",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyInternal)this).CertificateAuthorityConfigurationValidityNotAfter, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("LeafCertificateConfigurationValidityPeriodInDay")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyInternal)this).LeafCertificateConfigurationValidityPeriodInDay = (int?) content.GetValueForProperty("LeafCertificateConfigurationValidityPeriodInDay",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyInternal)this).LeafCertificateConfigurationValidityPeriodInDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal Policy(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.DeviceRegistry.Models.IPolicyInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.PolicyPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("SystemDataCreatedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataCreatedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Models.IResourceInternal)this).SystemDataCreatedByType = (string) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IResourceInternal)this).SystemDataCreatedByType, global::System.Convert.ToString); - } - if (content.Contains("SystemDataLastModifiedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataLastModifiedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IResourceInternal)this).SystemDataLastModifiedByType = (string) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IResourceInternal)this).SystemDataLastModifiedByType, global::System.Convert.ToString); - } - if (content.Contains("SystemDataLastModifiedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Models.IResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.SystemDataTypeConverter.ConvertFrom); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IResourceInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IResourceInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IResourceInternal)this).Type, global::System.Convert.ToString); - } - if (content.Contains("Tag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.TrackedResourceTagsTypeConverter.ConvertFrom); - } - if (content.Contains("Location")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ITrackedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ITrackedResourceInternal)this).Location, global::System.Convert.ToString); - } - if (content.Contains("ProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyInternal)this).ProvisioningState, global::System.Convert.ToString); - } - if (content.Contains("Certificate")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyInternal)this).Certificate = (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICertificateConfiguration) content.GetValueForProperty("Certificate",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyInternal)this).Certificate, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.CertificateConfigurationTypeConverter.ConvertFrom); - } - if (content.Contains("CertificateAuthorityConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyInternal)this).CertificateAuthorityConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICertificateAuthorityConfiguration) content.GetValueForProperty("CertificateAuthorityConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyInternal)this).CertificateAuthorityConfiguration, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.CertificateAuthorityConfigurationTypeConverter.ConvertFrom); - } - if (content.Contains("CertificateLeafCertificateConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyInternal)this).CertificateLeafCertificateConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ILeafCertificateConfiguration) content.GetValueForProperty("CertificateLeafCertificateConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyInternal)this).CertificateLeafCertificateConfiguration, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.LeafCertificateConfigurationTypeConverter.ConvertFrom); - } - if (content.Contains("CertificateAuthorityConfigurationSubject")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyInternal)this).CertificateAuthorityConfigurationSubject = (string) content.GetValueForProperty("CertificateAuthorityConfigurationSubject",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyInternal)this).CertificateAuthorityConfigurationSubject, global::System.Convert.ToString); - } - if (content.Contains("CertificateAuthorityConfigurationKeyType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyInternal)this).CertificateAuthorityConfigurationKeyType = (string) content.GetValueForProperty("CertificateAuthorityConfigurationKeyType",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyInternal)this).CertificateAuthorityConfigurationKeyType, global::System.Convert.ToString); - } - if (content.Contains("CertificateAuthorityConfigurationValidityNotBefore")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyInternal)this).CertificateAuthorityConfigurationValidityNotBefore = (global::System.DateTime?) content.GetValueForProperty("CertificateAuthorityConfigurationValidityNotBefore",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyInternal)this).CertificateAuthorityConfigurationValidityNotBefore, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("CertificateAuthorityConfigurationValidityNotAfter")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyInternal)this).CertificateAuthorityConfigurationValidityNotAfter = (global::System.DateTime?) content.GetValueForProperty("CertificateAuthorityConfigurationValidityNotAfter",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyInternal)this).CertificateAuthorityConfigurationValidityNotAfter, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("LeafCertificateConfigurationValidityPeriodInDay")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyInternal)this).LeafCertificateConfigurationValidityPeriodInDay = (int?) content.GetValueForProperty("LeafCertificateConfigurationValidityPeriodInDay",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyInternal)this).LeafCertificateConfigurationValidityPeriodInDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); - } - AfterDeserializePSObject(content); - } - - /// Serializes this instance to a json string. - - /// a containing this model serialized to JSON text. - public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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(); - } - } - /// A Credential Policy - [System.ComponentModel.TypeConverter(typeof(PolicyTypeConverter))] - public partial interface IPolicy - - { - - } -} \ No newline at end of file diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/Policy.TypeConverter.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/Policy.TypeConverter.cs deleted file mode 100644 index f8c2e46ad8bf..000000000000 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/Policy.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.DeviceRegistry.Models -{ - using Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.PowerShell; - - /// - /// A PowerShell PSTypeConverter to support converting to an instance of - /// - public partial class PolicyTypeConverter : 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.DeviceRegistry.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Models.IPolicy ConvertFrom(dynamic sourceValue) - { - if (null == sourceValue) - { - return null; - } - global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicy).IsAssignableFrom(type)) - { - return sourceValue; - } - try - { - return Policy.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; - } - catch - { - // Unable to use JSON pattern - } - if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) - { - return Policy.DeserializeFromPSObject(sourceValue); - } - if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) - { - return Policy.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/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/Policy.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/Policy.cs deleted file mode 100644 index 0fa69d96be44..000000000000 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/Policy.cs +++ /dev/null @@ -1,299 +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.DeviceRegistry.Models -{ - using static Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Extensions; - - /// A Credential Policy - public partial class Policy : - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicy, - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyInternal, - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IValidates - { - /// - /// Backing field for Inherited model - /// - private Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ITrackedResource __trackedResource = new Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.TrackedResource(); - - /// Crypto type: ECC. - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Origin(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.PropertyOrigin.Inlined)] - public string CertificateAuthorityConfigurationKeyType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyPropertiesInternal)Property).CertificateAuthorityConfigurationKeyType; } - - /// Certificate subject. - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Origin(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.PropertyOrigin.Inlined)] - public string CertificateAuthorityConfigurationSubject { get => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyPropertiesInternal)Property).CertificateAuthorityConfigurationSubject; } - - /// - /// Certificate is valid not after this date. Format ISO8601. Generated based on validity period. - /// - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Origin(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.PropertyOrigin.Inlined)] - public global::System.DateTime? CertificateAuthorityConfigurationValidityNotAfter { get => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyPropertiesInternal)Property).CertificateAuthorityConfigurationValidityNotAfter; } - - /// - /// Certificate is valid not before this date. Format ISO8601. Generated based on on validity period. - /// - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Origin(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.PropertyOrigin.Inlined)] - public global::System.DateTime? CertificateAuthorityConfigurationValidityNotBefore { get => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyPropertiesInternal)Property).CertificateAuthorityConfigurationValidityNotBefore; } - - /// - /// Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" - /// - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Origin(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.PropertyOrigin.Inherited)] - public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IResourceInternal)__trackedResource).Id; } - - /// The validity period in days. - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Origin(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.PropertyOrigin.Inlined)] - public int? LeafCertificateConfigurationValidityPeriodInDay { get => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyPropertiesInternal)Property).LeafCertificateConfigurationValidityPeriodInDay; set => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyPropertiesInternal)Property).LeafCertificateConfigurationValidityPeriodInDay = value ?? default(int); } - - /// The geo-location where the resource lives - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Origin(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.PropertyOrigin.Inherited)] - public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ITrackedResourceInternal)__trackedResource).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ITrackedResourceInternal)__trackedResource).Location = value ?? null; } - - /// Internal Acessors for Certificate - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICertificateConfiguration Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyInternal.Certificate { get => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyPropertiesInternal)Property).Certificate; set => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyPropertiesInternal)Property).Certificate = value ?? null /* model class */; } - - /// Internal Acessors for CertificateAuthorityConfiguration - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICertificateAuthorityConfiguration Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyInternal.CertificateAuthorityConfiguration { get => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyPropertiesInternal)Property).CertificateAuthorityConfiguration; set => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyPropertiesInternal)Property).CertificateAuthorityConfiguration = value ?? null /* model class */; } - - /// Internal Acessors for CertificateAuthorityConfigurationKeyType - string Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyInternal.CertificateAuthorityConfigurationKeyType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyPropertiesInternal)Property).CertificateAuthorityConfigurationKeyType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyPropertiesInternal)Property).CertificateAuthorityConfigurationKeyType = value ?? null; } - - /// Internal Acessors for CertificateAuthorityConfigurationSubject - string Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyInternal.CertificateAuthorityConfigurationSubject { get => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyPropertiesInternal)Property).CertificateAuthorityConfigurationSubject; set => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyPropertiesInternal)Property).CertificateAuthorityConfigurationSubject = value ?? null; } - - /// Internal Acessors for CertificateAuthorityConfigurationValidityNotAfter - global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyInternal.CertificateAuthorityConfigurationValidityNotAfter { get => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyPropertiesInternal)Property).CertificateAuthorityConfigurationValidityNotAfter; set => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyPropertiesInternal)Property).CertificateAuthorityConfigurationValidityNotAfter = value ?? default(global::System.DateTime); } - - /// Internal Acessors for CertificateAuthorityConfigurationValidityNotBefore - global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyInternal.CertificateAuthorityConfigurationValidityNotBefore { get => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyPropertiesInternal)Property).CertificateAuthorityConfigurationValidityNotBefore; set => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyPropertiesInternal)Property).CertificateAuthorityConfigurationValidityNotBefore = value ?? default(global::System.DateTime); } - - /// Internal Acessors for CertificateLeafCertificateConfiguration - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ILeafCertificateConfiguration Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyInternal.CertificateLeafCertificateConfiguration { get => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyPropertiesInternal)Property).CertificateLeafCertificateConfiguration; set => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyPropertiesInternal)Property).CertificateLeafCertificateConfiguration = value ?? null /* model class */; } - - /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyProperties Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.PolicyProperties()); set { {_property = value;} } } - - /// Internal Acessors for ProvisioningState - string Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyPropertiesInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyPropertiesInternal)Property).ProvisioningState = value ?? null; } - - /// Internal Acessors for Id - string Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IResourceInternal)__trackedResource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IResourceInternal)__trackedResource).Id = value ?? null; } - - /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IResourceInternal)__trackedResource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IResourceInternal)__trackedResource).Name = value ?? null; } - - /// Internal Acessors for SystemData - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ISystemData Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IResourceInternal.SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IResourceInternal)__trackedResource).SystemData; set => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IResourceInternal)__trackedResource).SystemData = value ?? null /* model class */; } - - /// Internal Acessors for SystemDataCreatedAt - global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IResourceInternal.SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IResourceInternal)__trackedResource).SystemDataCreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IResourceInternal)__trackedResource).SystemDataCreatedAt = value ?? default(global::System.DateTime); } - - /// Internal Acessors for SystemDataCreatedBy - string Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IResourceInternal.SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IResourceInternal)__trackedResource).SystemDataCreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IResourceInternal)__trackedResource).SystemDataCreatedBy = value ?? null; } - - /// Internal Acessors for SystemDataCreatedByType - string Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IResourceInternal.SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IResourceInternal)__trackedResource).SystemDataCreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IResourceInternal)__trackedResource).SystemDataCreatedByType = value ?? null; } - - /// Internal Acessors for SystemDataLastModifiedAt - global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IResourceInternal.SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedAt = value ?? default(global::System.DateTime); } - - /// Internal Acessors for SystemDataLastModifiedBy - string Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IResourceInternal.SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedBy = value ?? null; } - - /// Internal Acessors for SystemDataLastModifiedByType - string Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IResourceInternal.SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedByType = value ?? null; } - - /// Internal Acessors for Type - string Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IResourceInternal)__trackedResource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IResourceInternal)__trackedResource).Type = value ?? null; } - - /// The name of the resource - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Origin(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.PropertyOrigin.Inherited)] - public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IResourceInternal)__trackedResource).Name; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyProperties _property; - - /// The resource-specific properties for this resource. - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Origin(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.PolicyProperties()); set => this._property = value; } - - /// The status of the last operation. - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Origin(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.PropertyOrigin.Inlined)] - public string ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyPropertiesInternal)Property).ProvisioningState; } - - /// Gets the resource group name - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Origin(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Origin(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.PropertyOrigin.Inherited)] - internal Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ISystemData SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IResourceInternal)__trackedResource).SystemData; set => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IResourceInternal)__trackedResource).SystemData = value ?? null /* model class */; } - - /// The timestamp of resource creation (UTC). - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Origin(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.PropertyOrigin.Inherited)] - public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IResourceInternal)__trackedResource).SystemDataCreatedAt; } - - /// The identity that created the resource. - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Origin(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.PropertyOrigin.Inherited)] - public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IResourceInternal)__trackedResource).SystemDataCreatedBy; } - - /// The type of identity that created the resource. - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Origin(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.PropertyOrigin.Inherited)] - public string SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IResourceInternal)__trackedResource).SystemDataCreatedByType; } - - /// The timestamp of resource last modification (UTC) - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Origin(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.PropertyOrigin.Inherited)] - public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedAt; } - - /// The identity that last modified the resource. - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Origin(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.PropertyOrigin.Inherited)] - public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedBy; } - - /// The type of identity that last modified the resource. - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Origin(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.PropertyOrigin.Inherited)] - public string SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedByType; } - - /// Resource tags. - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Origin(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ITrackedResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ITrackedResourceInternal)__trackedResource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ITrackedResourceInternal)__trackedResource).Tag = value ?? null /* model class */; } - - /// - /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - /// - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Origin(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.PropertyOrigin.Inherited)] - public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IResourceInternal)__trackedResource).Type; } - - /// Creates an new instance. - public Policy() - { - - } - - /// 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.DeviceRegistry.Runtime.IEventListener eventListener) - { - await eventListener.AssertNotNull(nameof(__trackedResource), __trackedResource); - await eventListener.AssertObjectIsValid(nameof(__trackedResource), __trackedResource); - } - } - /// A Credential Policy - public partial interface IPolicy : - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ITrackedResource - { - /// Crypto type: ECC. - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Info( - Required = false, - ReadOnly = true, - Read = true, - Create = true, - Update = false, - Description = @"Crypto type: ECC.", - SerializedName = @"keyType", - PossibleTypes = new [] { typeof(string) })] - string CertificateAuthorityConfigurationKeyType { get; } - /// Certificate subject. - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Info( - Required = false, - ReadOnly = true, - Read = true, - Create = false, - Update = false, - Description = @"Certificate subject.", - SerializedName = @"subject", - PossibleTypes = new [] { typeof(string) })] - string CertificateAuthorityConfigurationSubject { get; } - /// - /// Certificate is valid not after this date. Format ISO8601. Generated based on validity period. - /// - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Info( - Required = false, - ReadOnly = true, - Read = true, - Create = false, - Update = false, - Description = @"Certificate is valid not after this date. Format ISO8601. Generated based on validity period.", - SerializedName = @"validityNotAfter", - PossibleTypes = new [] { typeof(global::System.DateTime) })] - global::System.DateTime? CertificateAuthorityConfigurationValidityNotAfter { get; } - /// - /// Certificate is valid not before this date. Format ISO8601. Generated based on on validity period. - /// - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Info( - Required = false, - ReadOnly = true, - Read = true, - Create = false, - Update = false, - Description = @"Certificate is valid not before this date. Format ISO8601. Generated based on on validity period.", - SerializedName = @"validityNotBefore", - PossibleTypes = new [] { typeof(global::System.DateTime) })] - global::System.DateTime? CertificateAuthorityConfigurationValidityNotBefore { get; } - /// The validity period in days. - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Info( - Required = false, - ReadOnly = false, - Read = true, - Create = true, - Update = true, - Description = @"The validity period in days.", - SerializedName = @"validityPeriodInDays", - PossibleTypes = new [] { typeof(int) })] - int? LeafCertificateConfigurationValidityPeriodInDay { get; set; } - /// The status of the last operation. - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Info( - Required = false, - ReadOnly = true, - Read = true, - Create = false, - Update = false, - Description = @"The status of the last operation.", - SerializedName = @"provisioningState", - PossibleTypes = new [] { typeof(string) })] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.PSArgumentCompleterAttribute("Succeeded", "Failed", "Canceled", "Accepted", "Deleting")] - string ProvisioningState { get; } - - } - /// A Credential Policy - internal partial interface IPolicyInternal : - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ITrackedResourceInternal - { - /// The certificate configuration. - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICertificateConfiguration Certificate { get; set; } - /// The configuration to set up an ICA. - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICertificateAuthorityConfiguration CertificateAuthorityConfiguration { get; set; } - /// Crypto type: ECC. - string CertificateAuthorityConfigurationKeyType { get; set; } - /// Certificate subject. - string CertificateAuthorityConfigurationSubject { get; set; } - /// - /// Certificate is valid not after this date. Format ISO8601. Generated based on validity period. - /// - global::System.DateTime? CertificateAuthorityConfigurationValidityNotAfter { get; set; } - /// - /// Certificate is valid not before this date. Format ISO8601. Generated based on on validity period. - /// - global::System.DateTime? CertificateAuthorityConfigurationValidityNotBefore { get; set; } - /// The leaf certificate configuration. - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ILeafCertificateConfiguration CertificateLeafCertificateConfiguration { get; set; } - /// The validity period in days. - int? LeafCertificateConfigurationValidityPeriodInDay { get; set; } - /// The resource-specific properties for this resource. - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyProperties Property { get; set; } - /// The status of the last operation. - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.PSArgumentCompleterAttribute("Succeeded", "Failed", "Canceled", "Accepted", "Deleting")] - string ProvisioningState { get; set; } - - } -} \ No newline at end of file diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/Policy.json.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/Policy.json.cs deleted file mode 100644 index 39ced5791a9d..000000000000 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/Policy.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.DeviceRegistry.Models -{ - using static Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Extensions; - - /// A Credential Policy - public partial class Policy - { - - /// - /// 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.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.Runtime.Json.JsonObject container, ref bool returnNow); - - /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicy. - /// - /// a to deserialize from. - /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicy. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicy FromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode node) - { - return node is Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonObject json ? new Policy(json) : null; - } - - /// - /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonObject into a new instance of . - /// - /// A Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonObject instance to deserialize from. - internal Policy(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonObject json) - { - bool returnNow = false; - BeforeFromJson(json, ref returnNow); - if (returnNow) - { - return; - } - __trackedResource = new Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.TrackedResource(json); - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.PolicyProperties.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.DeviceRegistry.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode serializationMode) - { - container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.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/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/PolicyListResult.PowerShell.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/PolicyListResult.PowerShell.cs deleted file mode 100644 index 3d4c3bf80b04..000000000000 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/PolicyListResult.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.DeviceRegistry.Models -{ - using Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.PowerShell; - - /// The response of a Policy list operation. - [System.ComponentModel.TypeConverter(typeof(PolicyListResultTypeConverter))] - public partial class PolicyListResult - { - - /// - /// 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.DeviceRegistry.Models.IPolicyListResult DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new PolicyListResult(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.DeviceRegistry.Models.IPolicyListResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new PolicyListResult(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.DeviceRegistry.Models.IPolicyListResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode.Parse(jsonText)); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal PolicyListResult(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.DeviceRegistry.Models.IPolicyListResultInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.PolicyTypeConverter.ConvertFrom)); - } - if (content.Contains("NextLink")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyListResultInternal)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 PolicyListResult(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.DeviceRegistry.Models.IPolicyListResultInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.PolicyTypeConverter.ConvertFrom)); - } - if (content.Contains("NextLink")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyListResultInternal)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.DeviceRegistry.Runtime.SerializationMode.IncludeAll)?.ToString(); - - public override string ToString() - { - var returnNow = false; - var result = global::System.String.Empty; - OverrideToString(ref result, ref returnNow); - if (returnNow) - { - return result; - } - return ToJsonString(); - } - } - /// The response of a Policy list operation. - [System.ComponentModel.TypeConverter(typeof(PolicyListResultTypeConverter))] - public partial interface IPolicyListResult - - { - - } -} \ No newline at end of file diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/PolicyListResult.TypeConverter.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/PolicyListResult.TypeConverter.cs deleted file mode 100644 index 339d096ef97d..000000000000 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/PolicyListResult.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.DeviceRegistry.Models -{ - using Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.PowerShell; - - /// - /// A PowerShell PSTypeConverter to support converting to an instance of - /// - public partial class PolicyListResultTypeConverter : 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.DeviceRegistry.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Models.IPolicyListResult ConvertFrom(dynamic sourceValue) - { - if (null == sourceValue) - { - return null; - } - global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyListResult).IsAssignableFrom(type)) - { - return sourceValue; - } - try - { - return PolicyListResult.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; - } - catch - { - // Unable to use JSON pattern - } - if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) - { - return PolicyListResult.DeserializeFromPSObject(sourceValue); - } - if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) - { - return PolicyListResult.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/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/PolicyListResult.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/PolicyListResult.cs deleted file mode 100644 index 32a689ba50f8..000000000000 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/PolicyListResult.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.DeviceRegistry.Models -{ - using static Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Extensions; - - /// The response of a Policy list operation. - public partial class PolicyListResult : - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyListResult, - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyListResultInternal - { - - /// Backing field for property. - private string _nextLink; - - /// The link to the next page of items - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Origin(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.PropertyOrigin.Owned)] - public string NextLink { get => this._nextLink; set => this._nextLink = value; } - - /// Backing field for property. - private System.Collections.Generic.List _value; - - /// The Policy items on this page - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Origin(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.PropertyOrigin.Owned)] - public System.Collections.Generic.List Value { get => this._value; set => this._value = value; } - - /// Creates an new instance. - public PolicyListResult() - { - - } - } - /// The response of a Policy list operation. - public partial interface IPolicyListResult : - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IJsonSerializable - { - /// The link to the next page of items - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Info( - Required = false, - ReadOnly = false, - Read = true, - Create = true, - Update = true, - Description = @"The link to the next page of items", - SerializedName = @"nextLink", - PossibleTypes = new [] { typeof(string) })] - string NextLink { get; set; } - /// The Policy items on this page - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Info( - Required = true, - ReadOnly = false, - Read = true, - Create = true, - Update = true, - Description = @"The Policy items on this page", - SerializedName = @"value", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicy) })] - System.Collections.Generic.List Value { get; set; } - - } - /// The response of a Policy list operation. - internal partial interface IPolicyListResultInternal - - { - /// The link to the next page of items - string NextLink { get; set; } - /// The Policy items on this page - System.Collections.Generic.List Value { get; set; } - - } -} \ No newline at end of file diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/PolicyListResult.json.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/PolicyListResult.json.cs deleted file mode 100644 index b73c75e9c069..000000000000 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/PolicyListResult.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.DeviceRegistry.Models -{ - using static Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Extensions; - - /// The response of a Policy list operation. - public partial class PolicyListResult - { - - /// - /// 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.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.Runtime.Json.JsonObject container, ref bool returnNow); - - /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyListResult. - /// - /// a to deserialize from. - /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyListResult. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyListResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode node) - { - return node is Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonObject json ? new PolicyListResult(json) : null; - } - - /// - /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonObject into a new instance of . - /// - /// A Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonObject instance to deserialize from. - internal PolicyListResult(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.Models.IPolicy) (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.Policy.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.DeviceRegistry.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode serializationMode) - { - container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/PolicyProperties.PowerShell.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/PolicyProperties.PowerShell.cs deleted file mode 100644 index cf1e95f82bd6..000000000000 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/PolicyProperties.PowerShell.cs +++ /dev/null @@ -1,228 +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.DeviceRegistry.Models -{ - using Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.PowerShell; - - /// Details of the Credential Policy. - [System.ComponentModel.TypeConverter(typeof(PolicyPropertiesTypeConverter))] - public partial class PolicyProperties - { - - /// - /// 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.DeviceRegistry.Models.IPolicyProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new PolicyProperties(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.DeviceRegistry.Models.IPolicyProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new PolicyProperties(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.DeviceRegistry.Models.IPolicyProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode.Parse(jsonText)); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal PolicyProperties(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("Certificate")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyPropertiesInternal)this).Certificate = (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICertificateConfiguration) content.GetValueForProperty("Certificate",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyPropertiesInternal)this).Certificate, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.CertificateConfigurationTypeConverter.ConvertFrom); - } - if (content.Contains("ProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyPropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyPropertiesInternal)this).ProvisioningState, global::System.Convert.ToString); - } - if (content.Contains("CertificateAuthorityConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyPropertiesInternal)this).CertificateAuthorityConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICertificateAuthorityConfiguration) content.GetValueForProperty("CertificateAuthorityConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyPropertiesInternal)this).CertificateAuthorityConfiguration, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.CertificateAuthorityConfigurationTypeConverter.ConvertFrom); - } - if (content.Contains("CertificateLeafCertificateConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyPropertiesInternal)this).CertificateLeafCertificateConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ILeafCertificateConfiguration) content.GetValueForProperty("CertificateLeafCertificateConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyPropertiesInternal)this).CertificateLeafCertificateConfiguration, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.LeafCertificateConfigurationTypeConverter.ConvertFrom); - } - if (content.Contains("CertificateAuthorityConfigurationSubject")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyPropertiesInternal)this).CertificateAuthorityConfigurationSubject = (string) content.GetValueForProperty("CertificateAuthorityConfigurationSubject",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyPropertiesInternal)this).CertificateAuthorityConfigurationSubject, global::System.Convert.ToString); - } - if (content.Contains("CertificateAuthorityConfigurationKeyType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyPropertiesInternal)this).CertificateAuthorityConfigurationKeyType = (string) content.GetValueForProperty("CertificateAuthorityConfigurationKeyType",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyPropertiesInternal)this).CertificateAuthorityConfigurationKeyType, global::System.Convert.ToString); - } - if (content.Contains("CertificateAuthorityConfigurationValidityNotBefore")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyPropertiesInternal)this).CertificateAuthorityConfigurationValidityNotBefore = (global::System.DateTime?) content.GetValueForProperty("CertificateAuthorityConfigurationValidityNotBefore",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyPropertiesInternal)this).CertificateAuthorityConfigurationValidityNotBefore, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("CertificateAuthorityConfigurationValidityNotAfter")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyPropertiesInternal)this).CertificateAuthorityConfigurationValidityNotAfter = (global::System.DateTime?) content.GetValueForProperty("CertificateAuthorityConfigurationValidityNotAfter",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyPropertiesInternal)this).CertificateAuthorityConfigurationValidityNotAfter, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("LeafCertificateConfigurationValidityPeriodInDay")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyPropertiesInternal)this).LeafCertificateConfigurationValidityPeriodInDay = (int?) content.GetValueForProperty("LeafCertificateConfigurationValidityPeriodInDay",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyPropertiesInternal)this).LeafCertificateConfigurationValidityPeriodInDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal PolicyProperties(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("Certificate")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyPropertiesInternal)this).Certificate = (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICertificateConfiguration) content.GetValueForProperty("Certificate",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyPropertiesInternal)this).Certificate, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.CertificateConfigurationTypeConverter.ConvertFrom); - } - if (content.Contains("ProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyPropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyPropertiesInternal)this).ProvisioningState, global::System.Convert.ToString); - } - if (content.Contains("CertificateAuthorityConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyPropertiesInternal)this).CertificateAuthorityConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICertificateAuthorityConfiguration) content.GetValueForProperty("CertificateAuthorityConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyPropertiesInternal)this).CertificateAuthorityConfiguration, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.CertificateAuthorityConfigurationTypeConverter.ConvertFrom); - } - if (content.Contains("CertificateLeafCertificateConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyPropertiesInternal)this).CertificateLeafCertificateConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ILeafCertificateConfiguration) content.GetValueForProperty("CertificateLeafCertificateConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyPropertiesInternal)this).CertificateLeafCertificateConfiguration, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.LeafCertificateConfigurationTypeConverter.ConvertFrom); - } - if (content.Contains("CertificateAuthorityConfigurationSubject")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyPropertiesInternal)this).CertificateAuthorityConfigurationSubject = (string) content.GetValueForProperty("CertificateAuthorityConfigurationSubject",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyPropertiesInternal)this).CertificateAuthorityConfigurationSubject, global::System.Convert.ToString); - } - if (content.Contains("CertificateAuthorityConfigurationKeyType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyPropertiesInternal)this).CertificateAuthorityConfigurationKeyType = (string) content.GetValueForProperty("CertificateAuthorityConfigurationKeyType",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyPropertiesInternal)this).CertificateAuthorityConfigurationKeyType, global::System.Convert.ToString); - } - if (content.Contains("CertificateAuthorityConfigurationValidityNotBefore")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyPropertiesInternal)this).CertificateAuthorityConfigurationValidityNotBefore = (global::System.DateTime?) content.GetValueForProperty("CertificateAuthorityConfigurationValidityNotBefore",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyPropertiesInternal)this).CertificateAuthorityConfigurationValidityNotBefore, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("CertificateAuthorityConfigurationValidityNotAfter")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyPropertiesInternal)this).CertificateAuthorityConfigurationValidityNotAfter = (global::System.DateTime?) content.GetValueForProperty("CertificateAuthorityConfigurationValidityNotAfter",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyPropertiesInternal)this).CertificateAuthorityConfigurationValidityNotAfter, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("LeafCertificateConfigurationValidityPeriodInDay")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyPropertiesInternal)this).LeafCertificateConfigurationValidityPeriodInDay = (int?) content.GetValueForProperty("LeafCertificateConfigurationValidityPeriodInDay",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyPropertiesInternal)this).LeafCertificateConfigurationValidityPeriodInDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); - } - AfterDeserializePSObject(content); - } - - /// Serializes this instance to a json string. - - /// a containing this model serialized to JSON text. - public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeAll)?.ToString(); - - public override string ToString() - { - var returnNow = false; - var result = global::System.String.Empty; - OverrideToString(ref result, ref returnNow); - if (returnNow) - { - return result; - } - return ToJsonString(); - } - } - /// Details of the Credential Policy. - [System.ComponentModel.TypeConverter(typeof(PolicyPropertiesTypeConverter))] - public partial interface IPolicyProperties - - { - - } -} \ No newline at end of file diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/PolicyProperties.TypeConverter.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/PolicyProperties.TypeConverter.cs deleted file mode 100644 index 527f09faac0d..000000000000 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/PolicyProperties.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.DeviceRegistry.Models -{ - using Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.PowerShell; - - /// - /// A PowerShell PSTypeConverter to support converting to an instance of - /// - public partial class PolicyPropertiesTypeConverter : 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.DeviceRegistry.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Models.IPolicyProperties ConvertFrom(dynamic sourceValue) - { - if (null == sourceValue) - { - return null; - } - global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyProperties).IsAssignableFrom(type)) - { - return sourceValue; - } - try - { - return PolicyProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; - } - catch - { - // Unable to use JSON pattern - } - if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) - { - return PolicyProperties.DeserializeFromPSObject(sourceValue); - } - if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) - { - return PolicyProperties.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/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/PolicyProperties.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/PolicyProperties.cs deleted file mode 100644 index 36820d739284..000000000000 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/PolicyProperties.cs +++ /dev/null @@ -1,190 +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.DeviceRegistry.Models -{ - using static Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Extensions; - - /// Details of the Credential Policy. - public partial class PolicyProperties : - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyProperties, - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyPropertiesInternal - { - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICertificateConfiguration _certificate; - - /// The certificate configuration. - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Origin(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICertificateConfiguration Certificate { get => (this._certificate = this._certificate ?? new Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.CertificateConfiguration()); set => this._certificate = value; } - - /// Crypto type: ECC. - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Origin(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.PropertyOrigin.Inlined)] - public string CertificateAuthorityConfigurationKeyType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICertificateConfigurationInternal)Certificate).CertificateAuthorityConfigurationKeyType; } - - /// Certificate subject. - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Origin(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.PropertyOrigin.Inlined)] - public string CertificateAuthorityConfigurationSubject { get => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICertificateConfigurationInternal)Certificate).CertificateAuthorityConfigurationSubject; } - - /// - /// Certificate is valid not after this date. Format ISO8601. Generated based on validity period. - /// - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Origin(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.PropertyOrigin.Inlined)] - public global::System.DateTime? CertificateAuthorityConfigurationValidityNotAfter { get => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICertificateConfigurationInternal)Certificate).CertificateAuthorityConfigurationValidityNotAfter; } - - /// - /// Certificate is valid not before this date. Format ISO8601. Generated based on on validity period. - /// - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Origin(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.PropertyOrigin.Inlined)] - public global::System.DateTime? CertificateAuthorityConfigurationValidityNotBefore { get => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICertificateConfigurationInternal)Certificate).CertificateAuthorityConfigurationValidityNotBefore; } - - /// The validity period in days. - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Origin(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.PropertyOrigin.Inlined)] - public int? LeafCertificateConfigurationValidityPeriodInDay { get => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICertificateConfigurationInternal)Certificate).LeafCertificateConfigurationValidityPeriodInDay; set => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICertificateConfigurationInternal)Certificate).LeafCertificateConfigurationValidityPeriodInDay = value ?? default(int); } - - /// Internal Acessors for Certificate - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICertificateConfiguration Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyPropertiesInternal.Certificate { get => (this._certificate = this._certificate ?? new Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.CertificateConfiguration()); set { {_certificate = value;} } } - - /// Internal Acessors for CertificateAuthorityConfiguration - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICertificateAuthorityConfiguration Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyPropertiesInternal.CertificateAuthorityConfiguration { get => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICertificateConfigurationInternal)Certificate).CertificateAuthorityConfiguration; set => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICertificateConfigurationInternal)Certificate).CertificateAuthorityConfiguration = value ?? null /* model class */; } - - /// Internal Acessors for CertificateAuthorityConfigurationKeyType - string Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyPropertiesInternal.CertificateAuthorityConfigurationKeyType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICertificateConfigurationInternal)Certificate).CertificateAuthorityConfigurationKeyType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICertificateConfigurationInternal)Certificate).CertificateAuthorityConfigurationKeyType = value ?? null; } - - /// Internal Acessors for CertificateAuthorityConfigurationSubject - string Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyPropertiesInternal.CertificateAuthorityConfigurationSubject { get => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICertificateConfigurationInternal)Certificate).CertificateAuthorityConfigurationSubject; set => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICertificateConfigurationInternal)Certificate).CertificateAuthorityConfigurationSubject = value ?? null; } - - /// Internal Acessors for CertificateAuthorityConfigurationValidityNotAfter - global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyPropertiesInternal.CertificateAuthorityConfigurationValidityNotAfter { get => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICertificateConfigurationInternal)Certificate).CertificateAuthorityConfigurationValidityNotAfter; set => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICertificateConfigurationInternal)Certificate).CertificateAuthorityConfigurationValidityNotAfter = value ?? default(global::System.DateTime); } - - /// Internal Acessors for CertificateAuthorityConfigurationValidityNotBefore - global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyPropertiesInternal.CertificateAuthorityConfigurationValidityNotBefore { get => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICertificateConfigurationInternal)Certificate).CertificateAuthorityConfigurationValidityNotBefore; set => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICertificateConfigurationInternal)Certificate).CertificateAuthorityConfigurationValidityNotBefore = value ?? default(global::System.DateTime); } - - /// Internal Acessors for CertificateLeafCertificateConfiguration - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ILeafCertificateConfiguration Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyPropertiesInternal.CertificateLeafCertificateConfiguration { get => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICertificateConfigurationInternal)Certificate).LeafCertificateConfiguration; set => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICertificateConfigurationInternal)Certificate).LeafCertificateConfiguration = value ?? null /* model class */; } - - /// Internal Acessors for ProvisioningState - string Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyPropertiesInternal.ProvisioningState { get => this._provisioningState; set { {_provisioningState = value;} } } - - /// Backing field for property. - private string _provisioningState; - - /// The status of the last operation. - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Origin(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.PropertyOrigin.Owned)] - public string ProvisioningState { get => this._provisioningState; } - - /// Creates an new instance. - public PolicyProperties() - { - - } - } - /// Details of the Credential Policy. - public partial interface IPolicyProperties : - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IJsonSerializable - { - /// Crypto type: ECC. - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Info( - Required = false, - ReadOnly = true, - Read = true, - Create = true, - Update = false, - Description = @"Crypto type: ECC.", - SerializedName = @"keyType", - PossibleTypes = new [] { typeof(string) })] - string CertificateAuthorityConfigurationKeyType { get; } - /// Certificate subject. - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Info( - Required = false, - ReadOnly = true, - Read = true, - Create = false, - Update = false, - Description = @"Certificate subject.", - SerializedName = @"subject", - PossibleTypes = new [] { typeof(string) })] - string CertificateAuthorityConfigurationSubject { get; } - /// - /// Certificate is valid not after this date. Format ISO8601. Generated based on validity period. - /// - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Info( - Required = false, - ReadOnly = true, - Read = true, - Create = false, - Update = false, - Description = @"Certificate is valid not after this date. Format ISO8601. Generated based on validity period.", - SerializedName = @"validityNotAfter", - PossibleTypes = new [] { typeof(global::System.DateTime) })] - global::System.DateTime? CertificateAuthorityConfigurationValidityNotAfter { get; } - /// - /// Certificate is valid not before this date. Format ISO8601. Generated based on on validity period. - /// - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Info( - Required = false, - ReadOnly = true, - Read = true, - Create = false, - Update = false, - Description = @"Certificate is valid not before this date. Format ISO8601. Generated based on on validity period.", - SerializedName = @"validityNotBefore", - PossibleTypes = new [] { typeof(global::System.DateTime) })] - global::System.DateTime? CertificateAuthorityConfigurationValidityNotBefore { get; } - /// The validity period in days. - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Info( - Required = false, - ReadOnly = false, - Read = true, - Create = true, - Update = true, - Description = @"The validity period in days.", - SerializedName = @"validityPeriodInDays", - PossibleTypes = new [] { typeof(int) })] - int? LeafCertificateConfigurationValidityPeriodInDay { get; set; } - /// The status of the last operation. - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Info( - Required = false, - ReadOnly = true, - Read = true, - Create = false, - Update = false, - Description = @"The status of the last operation.", - SerializedName = @"provisioningState", - PossibleTypes = new [] { typeof(string) })] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.PSArgumentCompleterAttribute("Succeeded", "Failed", "Canceled", "Accepted", "Deleting")] - string ProvisioningState { get; } - - } - /// Details of the Credential Policy. - internal partial interface IPolicyPropertiesInternal - - { - /// The certificate configuration. - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICertificateConfiguration Certificate { get; set; } - /// The configuration to set up an ICA. - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICertificateAuthorityConfiguration CertificateAuthorityConfiguration { get; set; } - /// Crypto type: ECC. - string CertificateAuthorityConfigurationKeyType { get; set; } - /// Certificate subject. - string CertificateAuthorityConfigurationSubject { get; set; } - /// - /// Certificate is valid not after this date. Format ISO8601. Generated based on validity period. - /// - global::System.DateTime? CertificateAuthorityConfigurationValidityNotAfter { get; set; } - /// - /// Certificate is valid not before this date. Format ISO8601. Generated based on on validity period. - /// - global::System.DateTime? CertificateAuthorityConfigurationValidityNotBefore { get; set; } - /// The leaf certificate configuration. - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ILeafCertificateConfiguration CertificateLeafCertificateConfiguration { get; set; } - /// The validity period in days. - int? LeafCertificateConfigurationValidityPeriodInDay { get; set; } - /// The status of the last operation. - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.PSArgumentCompleterAttribute("Succeeded", "Failed", "Canceled", "Accepted", "Deleting")] - string ProvisioningState { get; set; } - - } -} \ No newline at end of file diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/PolicyProperties.json.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/PolicyProperties.json.cs deleted file mode 100644 index 0c976296d525..000000000000 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/PolicyProperties.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.DeviceRegistry.Models -{ - using static Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Extensions; - - /// Details of the Credential Policy. - public partial class PolicyProperties - { - - /// - /// 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.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.Runtime.Json.JsonObject container, ref bool returnNow); - - /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyProperties. - /// - /// a to deserialize from. - /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyProperties. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode node) - { - return node is Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonObject json ? new PolicyProperties(json) : null; - } - - /// - /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonObject into a new instance of . - /// - /// A Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonObject instance to deserialize from. - internal PolicyProperties(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonObject json) - { - bool returnNow = false; - BeforeFromJson(json, ref returnNow); - if (returnNow) - { - return; - } - {_certificate = If( json?.PropertyT("certificate"), out var __jsonCertificate) ? Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.CertificateConfiguration.FromJson(__jsonCertificate) : _certificate;} - {_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.DeviceRegistry.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode serializationMode) - { - container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonObject(); - - bool returnNow = false; - BeforeToJson(ref container, ref returnNow); - if (returnNow) - { - return container; - } - AddIf( null != this._certificate ? (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode) this._certificate.ToJson(null,serializationMode) : null, "certificate" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeRead)) - { - AddIf( null != (((object)this._provisioningState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/PolicyUpdate.PowerShell.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/PolicyUpdate.PowerShell.cs deleted file mode 100644 index 2db11ed68751..000000000000 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/PolicyUpdate.PowerShell.cs +++ /dev/null @@ -1,204 +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.DeviceRegistry.Models -{ - using Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.PowerShell; - - /// The type used for update operations of the Policy. - [System.ComponentModel.TypeConverter(typeof(PolicyUpdateTypeConverter))] - public partial class PolicyUpdate - { - - /// - /// 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.DeviceRegistry.Models.IPolicyUpdate DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new PolicyUpdate(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.DeviceRegistry.Models.IPolicyUpdate DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new PolicyUpdate(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.DeviceRegistry.Models.IPolicyUpdate FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode.Parse(jsonText)); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal PolicyUpdate(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.DeviceRegistry.Models.IPolicyUpdateInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyUpdateProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyUpdateInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.PolicyUpdatePropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Tag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyUpdateInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyUpdateTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyUpdateInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.PolicyUpdateTagsTypeConverter.ConvertFrom); - } - if (content.Contains("Certificate")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyUpdateInternal)this).Certificate = (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICertificateConfigurationUpdate) content.GetValueForProperty("Certificate",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyUpdateInternal)this).Certificate, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.CertificateConfigurationUpdateTypeConverter.ConvertFrom); - } - if (content.Contains("CertificateLeafCertificateConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyUpdateInternal)this).CertificateLeafCertificateConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ILeafCertificateConfigurationUpdate) content.GetValueForProperty("CertificateLeafCertificateConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyUpdateInternal)this).CertificateLeafCertificateConfiguration, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.LeafCertificateConfigurationUpdateTypeConverter.ConvertFrom); - } - if (content.Contains("CertificateAuthorityConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyUpdateInternal)this).CertificateAuthorityConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAny) content.GetValueForProperty("CertificateAuthorityConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyUpdateInternal)this).CertificateAuthorityConfiguration, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.AnyTypeConverter.ConvertFrom); - } - if (content.Contains("LeafCertificateConfigurationValidityPeriodInDay")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyUpdateInternal)this).LeafCertificateConfigurationValidityPeriodInDay = (int?) content.GetValueForProperty("LeafCertificateConfigurationValidityPeriodInDay",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyUpdateInternal)this).LeafCertificateConfigurationValidityPeriodInDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal PolicyUpdate(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.DeviceRegistry.Models.IPolicyUpdateInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyUpdateProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyUpdateInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.PolicyUpdatePropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Tag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyUpdateInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyUpdateTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyUpdateInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.PolicyUpdateTagsTypeConverter.ConvertFrom); - } - if (content.Contains("Certificate")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyUpdateInternal)this).Certificate = (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICertificateConfigurationUpdate) content.GetValueForProperty("Certificate",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyUpdateInternal)this).Certificate, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.CertificateConfigurationUpdateTypeConverter.ConvertFrom); - } - if (content.Contains("CertificateLeafCertificateConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyUpdateInternal)this).CertificateLeafCertificateConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ILeafCertificateConfigurationUpdate) content.GetValueForProperty("CertificateLeafCertificateConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyUpdateInternal)this).CertificateLeafCertificateConfiguration, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.LeafCertificateConfigurationUpdateTypeConverter.ConvertFrom); - } - if (content.Contains("CertificateAuthorityConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyUpdateInternal)this).CertificateAuthorityConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAny) content.GetValueForProperty("CertificateAuthorityConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyUpdateInternal)this).CertificateAuthorityConfiguration, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.AnyTypeConverter.ConvertFrom); - } - if (content.Contains("LeafCertificateConfigurationValidityPeriodInDay")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyUpdateInternal)this).LeafCertificateConfigurationValidityPeriodInDay = (int?) content.GetValueForProperty("LeafCertificateConfigurationValidityPeriodInDay",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyUpdateInternal)this).LeafCertificateConfigurationValidityPeriodInDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); - } - AfterDeserializePSObject(content); - } - - /// Serializes this instance to a json string. - - /// a containing this model serialized to JSON text. - public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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 type used for update operations of the Policy. - [System.ComponentModel.TypeConverter(typeof(PolicyUpdateTypeConverter))] - public partial interface IPolicyUpdate - - { - - } -} \ No newline at end of file diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/PolicyUpdate.TypeConverter.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/PolicyUpdate.TypeConverter.cs deleted file mode 100644 index 09cba2a7020b..000000000000 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/PolicyUpdate.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.DeviceRegistry.Models -{ - using Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.PowerShell; - - /// - /// A PowerShell PSTypeConverter to support converting to an instance of - /// - public partial class PolicyUpdateTypeConverter : 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.DeviceRegistry.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Models.IPolicyUpdate ConvertFrom(dynamic sourceValue) - { - if (null == sourceValue) - { - return null; - } - global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyUpdate).IsAssignableFrom(type)) - { - return sourceValue; - } - try - { - return PolicyUpdate.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; - } - catch - { - // Unable to use JSON pattern - } - if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) - { - return PolicyUpdate.DeserializeFromPSObject(sourceValue); - } - if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) - { - return PolicyUpdate.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/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/PolicyUpdate.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/PolicyUpdate.cs deleted file mode 100644 index 53d44c9013da..000000000000 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/PolicyUpdate.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.DeviceRegistry.Models -{ - using static Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Extensions; - - /// The type used for update operations of the Policy. - public partial class PolicyUpdate : - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyUpdate, - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyUpdateInternal - { - - /// The configuration to set up an ICA. - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Origin(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAny CertificateAuthorityConfiguration { get => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyUpdatePropertiesInternal)Property).CertificateAuthorityConfiguration; set => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyUpdatePropertiesInternal)Property).CertificateAuthorityConfiguration = value ?? null /* model class */; } - - /// The validity period in days. - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Origin(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.PropertyOrigin.Inlined)] - public int? LeafCertificateConfigurationValidityPeriodInDay { get => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyUpdatePropertiesInternal)Property).LeafCertificateConfigurationValidityPeriodInDay; set => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyUpdatePropertiesInternal)Property).LeafCertificateConfigurationValidityPeriodInDay = value ?? default(int); } - - /// Internal Acessors for Certificate - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICertificateConfigurationUpdate Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyUpdateInternal.Certificate { get => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyUpdatePropertiesInternal)Property).Certificate; set => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyUpdatePropertiesInternal)Property).Certificate = value ?? null /* model class */; } - - /// Internal Acessors for CertificateLeafCertificateConfiguration - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ILeafCertificateConfigurationUpdate Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyUpdateInternal.CertificateLeafCertificateConfiguration { get => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyUpdatePropertiesInternal)Property).CertificateLeafCertificateConfiguration; set => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyUpdatePropertiesInternal)Property).CertificateLeafCertificateConfiguration = value ?? null /* model class */; } - - /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyUpdateProperties Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyUpdateInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.PolicyUpdateProperties()); set { {_property = value;} } } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyUpdateProperties _property; - - /// The resource-specific properties for this resource. - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Origin(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyUpdateProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.PolicyUpdateProperties()); set => this._property = value; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyUpdateTags _tag; - - /// Resource tags. - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Origin(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyUpdateTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.PolicyUpdateTags()); set => this._tag = value; } - - /// Creates an new instance. - public PolicyUpdate() - { - - } - } - /// The type used for update operations of the Policy. - public partial interface IPolicyUpdate : - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IJsonSerializable - { - /// The configuration to set up an ICA. - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Info( - Required = false, - ReadOnly = false, - Read = true, - Create = true, - Update = true, - Description = @"The configuration to set up an ICA.", - SerializedName = @"certificateAuthorityConfiguration", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAny) })] - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAny CertificateAuthorityConfiguration { get; set; } - /// The validity period in days. - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Info( - Required = false, - ReadOnly = false, - Read = true, - Create = true, - Update = true, - Description = @"The validity period in days.", - SerializedName = @"validityPeriodInDays", - PossibleTypes = new [] { typeof(int) })] - int? LeafCertificateConfigurationValidityPeriodInDay { get; set; } - /// Resource tags. - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Info( - Required = false, - ReadOnly = false, - Read = true, - Create = true, - Update = true, - Description = @"Resource tags.", - SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyUpdateTags) })] - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyUpdateTags Tag { get; set; } - - } - /// The type used for update operations of the Policy. - internal partial interface IPolicyUpdateInternal - - { - /// The certificate configuration. - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICertificateConfigurationUpdate Certificate { get; set; } - /// The configuration to set up an ICA. - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAny CertificateAuthorityConfiguration { get; set; } - /// The leaf certificate configuration. - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ILeafCertificateConfigurationUpdate CertificateLeafCertificateConfiguration { get; set; } - /// The validity period in days. - int? LeafCertificateConfigurationValidityPeriodInDay { get; set; } - /// The resource-specific properties for this resource. - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyUpdateProperties Property { get; set; } - /// Resource tags. - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyUpdateTags Tag { get; set; } - - } -} \ No newline at end of file diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/PolicyUpdate.json.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/PolicyUpdate.json.cs deleted file mode 100644 index 4e3702c657ee..000000000000 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/PolicyUpdate.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.DeviceRegistry.Models -{ - using static Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Extensions; - - /// The type used for update operations of the Policy. - public partial class PolicyUpdate - { - - /// - /// 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.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.Runtime.Json.JsonObject container, ref bool returnNow); - - /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyUpdate. - /// - /// a to deserialize from. - /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyUpdate. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyUpdate FromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode node) - { - return node is Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonObject json ? new PolicyUpdate(json) : null; - } - - /// - /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonObject into a new instance of . - /// - /// A Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonObject instance to deserialize from. - internal PolicyUpdate(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonObject json) - { - bool returnNow = false; - BeforeFromJson(json, ref returnNow); - if (returnNow) - { - return; - } - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.PolicyUpdateProperties.FromJson(__jsonProperties) : _property;} - {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.PolicyUpdateTags.FromJson(__jsonTags) : _tag;} - AfterFromJson(json); - } - - /// - /// Serializes this instance of into a . - /// - /// The container to serialize this object into. If the caller - /// passes in null, a new instance will be created and returned to the caller. - /// Allows the caller to choose the depth of the serialization. See . - /// - /// a serialized instance of as a . - /// - public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode serializationMode) - { - container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonObject(); - - bool returnNow = false; - BeforeToJson(ref container, ref returnNow); - if (returnNow) - { - return container; - } - AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); - AddIf( null != this._tag ? (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode) this._tag.ToJson(null,serializationMode) : null, "tags" ,container.Add ); - AfterToJson(ref container); - return container; - } - } -} \ No newline at end of file diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/PolicyUpdateProperties.PowerShell.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/PolicyUpdateProperties.PowerShell.cs deleted file mode 100644 index a045957c556c..000000000000 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/PolicyUpdateProperties.PowerShell.cs +++ /dev/null @@ -1,188 +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.DeviceRegistry.Models -{ - using Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.PowerShell; - - /// The updatable properties of the Policy. - [System.ComponentModel.TypeConverter(typeof(PolicyUpdatePropertiesTypeConverter))] - public partial class PolicyUpdateProperties - { - - /// - /// 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.DeviceRegistry.Models.IPolicyUpdateProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new PolicyUpdateProperties(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.DeviceRegistry.Models.IPolicyUpdateProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new PolicyUpdateProperties(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.DeviceRegistry.Models.IPolicyUpdateProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode.Parse(jsonText)); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal PolicyUpdateProperties(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("Certificate")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyUpdatePropertiesInternal)this).Certificate = (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICertificateConfigurationUpdate) content.GetValueForProperty("Certificate",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyUpdatePropertiesInternal)this).Certificate, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.CertificateConfigurationUpdateTypeConverter.ConvertFrom); - } - if (content.Contains("CertificateLeafCertificateConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyUpdatePropertiesInternal)this).CertificateLeafCertificateConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ILeafCertificateConfigurationUpdate) content.GetValueForProperty("CertificateLeafCertificateConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyUpdatePropertiesInternal)this).CertificateLeafCertificateConfiguration, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.LeafCertificateConfigurationUpdateTypeConverter.ConvertFrom); - } - if (content.Contains("CertificateAuthorityConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyUpdatePropertiesInternal)this).CertificateAuthorityConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAny) content.GetValueForProperty("CertificateAuthorityConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyUpdatePropertiesInternal)this).CertificateAuthorityConfiguration, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.AnyTypeConverter.ConvertFrom); - } - if (content.Contains("LeafCertificateConfigurationValidityPeriodInDay")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyUpdatePropertiesInternal)this).LeafCertificateConfigurationValidityPeriodInDay = (int?) content.GetValueForProperty("LeafCertificateConfigurationValidityPeriodInDay",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyUpdatePropertiesInternal)this).LeafCertificateConfigurationValidityPeriodInDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal PolicyUpdateProperties(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("Certificate")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyUpdatePropertiesInternal)this).Certificate = (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICertificateConfigurationUpdate) content.GetValueForProperty("Certificate",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyUpdatePropertiesInternal)this).Certificate, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.CertificateConfigurationUpdateTypeConverter.ConvertFrom); - } - if (content.Contains("CertificateLeafCertificateConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyUpdatePropertiesInternal)this).CertificateLeafCertificateConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ILeafCertificateConfigurationUpdate) content.GetValueForProperty("CertificateLeafCertificateConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyUpdatePropertiesInternal)this).CertificateLeafCertificateConfiguration, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.LeafCertificateConfigurationUpdateTypeConverter.ConvertFrom); - } - if (content.Contains("CertificateAuthorityConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyUpdatePropertiesInternal)this).CertificateAuthorityConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAny) content.GetValueForProperty("CertificateAuthorityConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyUpdatePropertiesInternal)this).CertificateAuthorityConfiguration, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.AnyTypeConverter.ConvertFrom); - } - if (content.Contains("LeafCertificateConfigurationValidityPeriodInDay")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyUpdatePropertiesInternal)this).LeafCertificateConfigurationValidityPeriodInDay = (int?) content.GetValueForProperty("LeafCertificateConfigurationValidityPeriodInDay",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyUpdatePropertiesInternal)this).LeafCertificateConfigurationValidityPeriodInDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); - } - AfterDeserializePSObject(content); - } - - /// Serializes this instance to a json string. - - /// a containing this model serialized to JSON text. - public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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 updatable properties of the Policy. - [System.ComponentModel.TypeConverter(typeof(PolicyUpdatePropertiesTypeConverter))] - public partial interface IPolicyUpdateProperties - - { - - } -} \ No newline at end of file diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/PolicyUpdateProperties.TypeConverter.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/PolicyUpdateProperties.TypeConverter.cs deleted file mode 100644 index dcd74dd3aca0..000000000000 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/PolicyUpdateProperties.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.DeviceRegistry.Models -{ - using Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.PowerShell; - - /// - /// A PowerShell PSTypeConverter to support converting to an instance of - /// - public partial class PolicyUpdatePropertiesTypeConverter : 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.DeviceRegistry.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Models.IPolicyUpdateProperties ConvertFrom(dynamic sourceValue) - { - if (null == sourceValue) - { - return null; - } - global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyUpdateProperties).IsAssignableFrom(type)) - { - return sourceValue; - } - try - { - return PolicyUpdateProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; - } - catch - { - // Unable to use JSON pattern - } - if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) - { - return PolicyUpdateProperties.DeserializeFromPSObject(sourceValue); - } - if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) - { - return PolicyUpdateProperties.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/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/PolicyUpdateProperties.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/PolicyUpdateProperties.cs deleted file mode 100644 index 8332e8ba5b2e..000000000000 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/PolicyUpdateProperties.cs +++ /dev/null @@ -1,85 +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.DeviceRegistry.Models -{ - using static Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Extensions; - - /// The updatable properties of the Policy. - public partial class PolicyUpdateProperties : - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyUpdateProperties, - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyUpdatePropertiesInternal - { - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICertificateConfigurationUpdate _certificate; - - /// The certificate configuration. - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Origin(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICertificateConfigurationUpdate Certificate { get => (this._certificate = this._certificate ?? new Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.CertificateConfigurationUpdate()); set => this._certificate = value; } - - /// The configuration to set up an ICA. - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Origin(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAny CertificateAuthorityConfiguration { get => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICertificateConfigurationUpdateInternal)Certificate).CertificateAuthorityConfiguration; set => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICertificateConfigurationUpdateInternal)Certificate).CertificateAuthorityConfiguration = value ?? null /* model class */; } - - /// The validity period in days. - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Origin(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.PropertyOrigin.Inlined)] - public int? LeafCertificateConfigurationValidityPeriodInDay { get => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICertificateConfigurationUpdateInternal)Certificate).LeafCertificateConfigurationValidityPeriodInDay; set => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICertificateConfigurationUpdateInternal)Certificate).LeafCertificateConfigurationValidityPeriodInDay = value ?? default(int); } - - /// Internal Acessors for Certificate - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICertificateConfigurationUpdate Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyUpdatePropertiesInternal.Certificate { get => (this._certificate = this._certificate ?? new Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.CertificateConfigurationUpdate()); set { {_certificate = value;} } } - - /// Internal Acessors for CertificateLeafCertificateConfiguration - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ILeafCertificateConfigurationUpdate Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyUpdatePropertiesInternal.CertificateLeafCertificateConfiguration { get => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICertificateConfigurationUpdateInternal)Certificate).LeafCertificateConfiguration; set => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICertificateConfigurationUpdateInternal)Certificate).LeafCertificateConfiguration = value ?? null /* model class */; } - - /// Creates an new instance. - public PolicyUpdateProperties() - { - - } - } - /// The updatable properties of the Policy. - public partial interface IPolicyUpdateProperties : - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IJsonSerializable - { - /// The configuration to set up an ICA. - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Info( - Required = false, - ReadOnly = false, - Read = true, - Create = true, - Update = true, - Description = @"The configuration to set up an ICA.", - SerializedName = @"certificateAuthorityConfiguration", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAny) })] - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAny CertificateAuthorityConfiguration { get; set; } - /// The validity period in days. - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Info( - Required = false, - ReadOnly = false, - Read = true, - Create = true, - Update = true, - Description = @"The validity period in days.", - SerializedName = @"validityPeriodInDays", - PossibleTypes = new [] { typeof(int) })] - int? LeafCertificateConfigurationValidityPeriodInDay { get; set; } - - } - /// The updatable properties of the Policy. - internal partial interface IPolicyUpdatePropertiesInternal - - { - /// The certificate configuration. - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICertificateConfigurationUpdate Certificate { get; set; } - /// The configuration to set up an ICA. - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAny CertificateAuthorityConfiguration { get; set; } - /// The leaf certificate configuration. - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ILeafCertificateConfigurationUpdate CertificateLeafCertificateConfiguration { get; set; } - /// The validity period in days. - int? LeafCertificateConfigurationValidityPeriodInDay { get; set; } - - } -} \ No newline at end of file diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/PolicyUpdateProperties.json.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/PolicyUpdateProperties.json.cs deleted file mode 100644 index 554ae95ca743..000000000000 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/PolicyUpdateProperties.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.DeviceRegistry.Models -{ - using static Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Extensions; - - /// The updatable properties of the Policy. - public partial class PolicyUpdateProperties - { - - /// - /// 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.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.Runtime.Json.JsonObject container, ref bool returnNow); - - /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyUpdateProperties. - /// - /// a to deserialize from. - /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyUpdateProperties. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyUpdateProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode node) - { - return node is Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonObject json ? new PolicyUpdateProperties(json) : null; - } - - /// - /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonObject into a new instance of . - /// - /// A Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonObject instance to deserialize from. - internal PolicyUpdateProperties(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonObject json) - { - bool returnNow = false; - BeforeFromJson(json, ref returnNow); - if (returnNow) - { - return; - } - {_certificate = If( json?.PropertyT("certificate"), out var __jsonCertificate) ? Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.CertificateConfigurationUpdate.FromJson(__jsonCertificate) : _certificate;} - 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.DeviceRegistry.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode serializationMode) - { - container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonObject(); - - bool returnNow = false; - BeforeToJson(ref container, ref returnNow); - if (returnNow) - { - return container; - } - AddIf( null != this._certificate ? (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode) this._certificate.ToJson(null,serializationMode) : null, "certificate" ,container.Add ); - AfterToJson(ref container); - return container; - } - } -} \ No newline at end of file diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/PolicyUpdateTags.PowerShell.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/PolicyUpdateTags.PowerShell.cs deleted file mode 100644 index 6350b2a2638e..000000000000 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/PolicyUpdateTags.PowerShell.cs +++ /dev/null @@ -1,160 +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.DeviceRegistry.Models -{ - using Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.PowerShell; - - /// Resource tags. - [System.ComponentModel.TypeConverter(typeof(PolicyUpdateTagsTypeConverter))] - public partial class PolicyUpdateTags - { - - /// - /// 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.DeviceRegistry.Models.IPolicyUpdateTags DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new PolicyUpdateTags(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.DeviceRegistry.Models.IPolicyUpdateTags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new PolicyUpdateTags(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.DeviceRegistry.Models.IPolicyUpdateTags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode.Parse(jsonText)); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal PolicyUpdateTags(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - // this type is a dictionary; copy elements from source to here. - CopyFrom(content); - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal PolicyUpdateTags(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - // this type is a dictionary; copy elements from source to here. - CopyFrom(content); - AfterDeserializePSObject(content); - } - - /// Serializes this instance to a json string. - - /// a containing this model serialized to JSON text. - public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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(); - } - } - /// Resource tags. - [System.ComponentModel.TypeConverter(typeof(PolicyUpdateTagsTypeConverter))] - public partial interface IPolicyUpdateTags - - { - - } -} \ No newline at end of file diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/PolicyUpdateTags.TypeConverter.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/PolicyUpdateTags.TypeConverter.cs deleted file mode 100644 index b409ac4bf619..000000000000 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/PolicyUpdateTags.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.DeviceRegistry.Models -{ - using Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.PowerShell; - - /// - /// A PowerShell PSTypeConverter to support converting to an instance of - /// - public partial class PolicyUpdateTagsTypeConverter : 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.DeviceRegistry.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Models.IPolicyUpdateTags ConvertFrom(dynamic sourceValue) - { - if (null == sourceValue) - { - return null; - } - global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyUpdateTags).IsAssignableFrom(type)) - { - return sourceValue; - } - try - { - return PolicyUpdateTags.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; - } - catch - { - // Unable to use JSON pattern - } - if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) - { - return PolicyUpdateTags.DeserializeFromPSObject(sourceValue); - } - if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) - { - return PolicyUpdateTags.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/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/PolicyUpdateTags.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/PolicyUpdateTags.cs deleted file mode 100644 index 3a5bbb48b521..000000000000 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/PolicyUpdateTags.cs +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models -{ - using static Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Extensions; - - /// Resource tags. - public partial class PolicyUpdateTags : - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyUpdateTags, - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyUpdateTagsInternal - { - - /// Creates an new instance. - public PolicyUpdateTags() - { - - } - } - /// Resource tags. - public partial interface IPolicyUpdateTags : - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IAssociativeArray - { - - } - /// Resource tags. - internal partial interface IPolicyUpdateTagsInternal - - { - - } -} \ No newline at end of file diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/PolicyUpdateTags.dictionary.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/PolicyUpdateTags.dictionary.cs deleted file mode 100644 index cbd638813dd2..000000000000 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/PolicyUpdateTags.dictionary.cs +++ /dev/null @@ -1,75 +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.DeviceRegistry.Models -{ - using static Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Extensions; - - public partial class PolicyUpdateTags : - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IAssociativeArray - { - protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); - - global::System.Collections.Generic.IDictionary Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IAssociativeArray.AdditionalProperties { get => __additionalProperties; } - - int Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IAssociativeArray.Count { get => __additionalProperties.Count; } - - global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IAssociativeArray.Keys { get => __additionalProperties.Keys; } - - global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IAssociativeArray.Values { get => __additionalProperties.Values; } - - public string this[global::System.String index] { get => __additionalProperties[index]; set => __additionalProperties[index] = value; } - - /// - /// - public void Add(global::System.String key, string value) => __additionalProperties.Add( key, value); - - public void Clear() => __additionalProperties.Clear(); - - /// - public bool ContainsKey(global::System.String key) => __additionalProperties.ContainsKey( key); - - /// - public void CopyFrom(global::System.Collections.IDictionary source) - { - if (null != source) - { - foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) - { - if ((null != property.Key && null != property.Value)) - { - this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); - } - } - } - } - - /// - public void CopyFrom(global::System.Management.Automation.PSObject source) - { - if (null != source) - { - foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) - { - if ((null != property.Key && null != property.Value)) - { - this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); - } - } - } - } - - /// - public bool Remove(global::System.String key) => __additionalProperties.Remove( key); - - /// - /// - public bool TryGetValue(global::System.String key, out string value) => __additionalProperties.TryGetValue( key, out value); - - /// - - public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.PolicyUpdateTags source) => source.__additionalProperties; - } -} \ No newline at end of file diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/PolicyUpdateTags.json.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/PolicyUpdateTags.json.cs deleted file mode 100644 index a4adc30d1549..000000000000 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/api/Models/PolicyUpdateTags.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.DeviceRegistry.Models -{ - using static Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Extensions; - - /// Resource tags. - public partial class PolicyUpdateTags - { - - /// - /// 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.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.Runtime.Json.JsonObject container, ref bool returnNow); - - /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyUpdateTags. - /// - /// a to deserialize from. - /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyUpdateTags. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyUpdateTags FromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode node) - { - return node is Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonObject json ? new PolicyUpdateTags(json) : null; - } - - /// - /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonObject into a new instance of . - /// - /// A Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonObject instance to deserialize from. - /// - internal PolicyUpdateTags(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) - { - bool returnNow = false; - BeforeFromJson(json, ref returnNow); - if (returnNow) - { - return; - } - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IAssociativeArray)this).AdditionalProperties, null ,exclusions ); - AfterFromJson(json); - } - - /// - /// Serializes this instance of into a . - /// - /// The container to serialize this object into. If the caller - /// passes in null, a new instance will be created and returned to the caller. - /// Allows the caller to choose the depth of the serialization. See . - /// - /// a serialized instance of as a . - /// - public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode serializationMode) - { - container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonObject(); - - bool returnNow = false; - BeforeToJson(ref container, ref returnNow); - if (returnNow) - { - return container; - } - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IAssociativeArray)this).AdditionalProperties, container); - AfterToJson(ref container); - return container; - } - } -} \ No newline at end of file diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistryAssetEndpointProfile_Get.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistryAssetEndpointProfile_Get.cs index 4927bba589ae..d07c2802380d 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistryAssetEndpointProfile_Get.cs +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistryAssetEndpointProfile_Get.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetEndpointProfile))] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Description(@"Get a AssetEndpointProfile")] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/assetEndpointProfiles/{assetEndpointProfileName}", ApiVersion = "2025-11-01-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/assetEndpointProfiles/{assetEndpointProfileName}", ApiVersion = "2025-10-01")] public partial class GetAzDeviceRegistryAssetEndpointProfile_Get : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IContext diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistryAssetEndpointProfile_GetViaIdentity.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistryAssetEndpointProfile_GetViaIdentity.cs index 7ae27ee628e1..0b13357031f5 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistryAssetEndpointProfile_GetViaIdentity.cs +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistryAssetEndpointProfile_GetViaIdentity.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetEndpointProfile))] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Description(@"Get a AssetEndpointProfile")] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/assetEndpointProfiles/{assetEndpointProfileName}", ApiVersion = "2025-11-01-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/assetEndpointProfiles/{assetEndpointProfileName}", ApiVersion = "2025-10-01")] public partial class GetAzDeviceRegistryAssetEndpointProfile_GetViaIdentity : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IContext diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistryAssetEndpointProfile_List.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistryAssetEndpointProfile_List.cs index be22a167e439..d3250448a3e9 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistryAssetEndpointProfile_List.cs +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistryAssetEndpointProfile_List.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetEndpointProfile))] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Description(@"List AssetEndpointProfile resources by subscription ID")] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/providers/Microsoft.DeviceRegistry/assetEndpointProfiles", ApiVersion = "2025-11-01-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/providers/Microsoft.DeviceRegistry/assetEndpointProfiles", ApiVersion = "2025-10-01")] public partial class GetAzDeviceRegistryAssetEndpointProfile_List : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IContext diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistryAssetEndpointProfile_List1.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistryAssetEndpointProfile_List1.cs index c8f6249a3ec9..8ac84bd0af72 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistryAssetEndpointProfile_List1.cs +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistryAssetEndpointProfile_List1.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetEndpointProfile))] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Description(@"List AssetEndpointProfile resources by resource group")] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/assetEndpointProfiles", ApiVersion = "2025-11-01-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/assetEndpointProfiles", ApiVersion = "2025-10-01")] public partial class GetAzDeviceRegistryAssetEndpointProfile_List1 : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IContext diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistryAsset_Get.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistryAsset_Get.cs index ca1624c78ec7..de59151f426a 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistryAsset_Get.cs +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistryAsset_Get.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAsset))] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Description(@"Get a Asset")] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/assets/{assetName}", ApiVersion = "2025-11-01-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/assets/{assetName}", ApiVersion = "2025-10-01")] public partial class GetAzDeviceRegistryAsset_Get : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IContext diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistryAsset_GetViaIdentity.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistryAsset_GetViaIdentity.cs index 73dc68720aad..a5551779496c 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistryAsset_GetViaIdentity.cs +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistryAsset_GetViaIdentity.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAsset))] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Description(@"Get a Asset")] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/assets/{assetName}", ApiVersion = "2025-11-01-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/assets/{assetName}", ApiVersion = "2025-10-01")] public partial class GetAzDeviceRegistryAsset_GetViaIdentity : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IContext diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistryAsset_List.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistryAsset_List.cs index 82b3f4c98b51..0d3a484cba2d 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistryAsset_List.cs +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistryAsset_List.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAsset))] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Description(@"List Asset resources by subscription ID")] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/providers/Microsoft.DeviceRegistry/assets", ApiVersion = "2025-11-01-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/providers/Microsoft.DeviceRegistry/assets", ApiVersion = "2025-10-01")] public partial class GetAzDeviceRegistryAsset_List : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IContext diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistryAsset_List1.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistryAsset_List1.cs index 685926067949..764a5405b7e7 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistryAsset_List1.cs +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistryAsset_List1.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAsset))] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Description(@"List Asset resources by resource group")] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/assets", ApiVersion = "2025-11-01-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/assets", ApiVersion = "2025-10-01")] public partial class GetAzDeviceRegistryAsset_List1 : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IContext diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistryBillingContainer_Get.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistryBillingContainer_Get.cs index 0d09144e054a..ecdbf89b007b 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistryBillingContainer_Get.cs +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistryBillingContainer_Get.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IBillingContainer))] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Description(@"Get a BillingContainer")] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/providers/Microsoft.DeviceRegistry/billingContainers/{billingContainerName}", ApiVersion = "2025-11-01-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/providers/Microsoft.DeviceRegistry/billingContainers/{billingContainerName}", ApiVersion = "2025-10-01")] public partial class GetAzDeviceRegistryBillingContainer_Get : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IContext diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistryBillingContainer_GetViaIdentity.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistryBillingContainer_GetViaIdentity.cs index 58bb78a43e36..0e3a5734fb63 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistryBillingContainer_GetViaIdentity.cs +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistryBillingContainer_GetViaIdentity.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IBillingContainer))] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Description(@"Get a BillingContainer")] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/providers/Microsoft.DeviceRegistry/billingContainers/{billingContainerName}", ApiVersion = "2025-11-01-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/providers/Microsoft.DeviceRegistry/billingContainers/{billingContainerName}", ApiVersion = "2025-10-01")] public partial class GetAzDeviceRegistryBillingContainer_GetViaIdentity : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IContext diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistryBillingContainer_List.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistryBillingContainer_List.cs index 92aabb0626ea..f42b862c7e28 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistryBillingContainer_List.cs +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistryBillingContainer_List.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IBillingContainer))] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Description(@"List BillingContainer resources by subscription ID")] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/providers/Microsoft.DeviceRegistry/billingContainers", ApiVersion = "2025-11-01-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/providers/Microsoft.DeviceRegistry/billingContainers", ApiVersion = "2025-10-01")] public partial class GetAzDeviceRegistryBillingContainer_List : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IContext diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistryCredentials_Get.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistryCredentials_Get.cs deleted file mode 100644 index 801a82eb6699..000000000000 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistryCredentials_Get.cs +++ /dev/null @@ -1,507 +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.DeviceRegistry.Cmdlets -{ - using static Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Extensions; - using Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.PowerShell; - using Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Cmdlets; - using System; - - /// Get a Credential - /// - /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/credentials/default" - /// - [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzDeviceRegistryCredentials_Get")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICredential))] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Description(@"Get a Credential")] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/credentials/default", ApiVersion = "2025-11-01-preview")] - public partial class GetAzDeviceRegistryCredentials_Get : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener, - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.DeviceRegistry Client => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.ParameterCategory.Runtime)] - public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.ParameterCategory.Runtime)] - public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } - - /// Accessor for our copy of the InvocationInfo. - public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } - - /// - /// cancellation delegate. Stops the cmdlet when called. - /// - global::System.Action Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; - - /// cancellation token. - global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener.Token => _cancellationTokenSource.Token; - - /// Backing field for property. - private string _namespaceName; - - /// The name of the namespace. - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the namespace.")] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The name of the namespace.", - SerializedName = @"namespaceName", - PossibleTypes = new [] { typeof(string) })] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.ParameterCategory.Path)] - public string NamespaceName { get => this._namespaceName; set => this._namespaceName = value; } - - /// - /// The instance of the that the remote call will use. - /// - public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The name of the resource group. The name is case insensitive.", - SerializedName = @"resourceGroupName", - PossibleTypes = new [] { typeof(string) })] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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. The value must be an UUID. - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription. The value must be an UUID.")] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The ID of the target subscription. The value must be an UUID.", - SerializedName = @"subscriptionId", - PossibleTypes = new [] { typeof(string) })] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.DefaultInfo( - Name = @"", - Description =@"", - Script = @"(Get-AzContext).Subscription.Id", - SetCondition = @"")] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.Models.ICredential - /// 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.DeviceRegistry.Module.Instance.GetTelemetryId.Invoke(); - if (telemetryId != "" && telemetryId != "internal") - { - __correlationId = telemetryId; - } - Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); - if (Break) - { - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.AttachDebugger.Break(); - } - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.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 GetAzDeviceRegistryCredentials_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.DeviceRegistry.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.DeviceRegistry.Runtime.Events.Verbose: - { - WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.Warning: - { - WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.Information: - { - var data = messageData(); - WriteInformation(data.Message, new string[]{}); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.Debug: - { - WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - __processRecordId = System.Guid.NewGuid().ToString(); - try - { - // work - using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Token) ) - { - asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); - if (null != HttpPipelinePrepend) - { - Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); - } - if (null != HttpPipelineAppend) - { - Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); - } - // get the client instance - try - { - foreach( var SubscriptionId in this.SubscriptionId ) - { - await ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.CredentialsGet(SubscriptionId, ResourceGroupName, NamespaceName, onOk, onDefault, this, Pipeline); - await ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - } - } - catch (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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,NamespaceName=NamespaceName}) - { - ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } - }); - } - finally - { - await ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletProcessRecordAsyncEnd); - } - } - } - - /// Interrupts currently running code within the command. - protected override void StopProcessing() - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Cancel(); - base.StopProcessing(); - } - - /// - new protected void WriteObject(object sendToPipeline) - { - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); - base.WriteObject(sendToPipeline); - } - - /// - /// - new protected void WriteObject(object sendToPipeline, bool enumerateCollection) - { - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.Models.ICredential - /// 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.DeviceRegistry.Models.ICredential - 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/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistryCredentials_GetViaIdentity.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistryCredentials_GetViaIdentity.cs deleted file mode 100644 index 627fbb17f5e9..000000000000 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistryCredentials_GetViaIdentity.cs +++ /dev/null @@ -1,485 +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.DeviceRegistry.Cmdlets -{ - using static Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Extensions; - using Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.PowerShell; - using Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Cmdlets; - using System; - - /// Get a Credential - /// - /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/credentials/default" - /// - [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzDeviceRegistryCredentials_GetViaIdentity")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICredential))] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Description(@"Get a Credential")] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/credentials/default", ApiVersion = "2025-11-01-preview")] - public partial class GetAzDeviceRegistryCredentials_GetViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener, - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.DeviceRegistry Client => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.ParameterCategory.Runtime)] - public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.ParameterCategory.Runtime)] - public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IDeviceRegistryIdentity _inputObject; - - /// Identity Parameter - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.ParameterCategory.Path)] - public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IDeviceRegistryIdentity 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.DeviceRegistry.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; - - /// cancellation token. - global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener.Token => _cancellationTokenSource.Token; - - /// - /// The instance of the that the remote call will use. - /// - public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.Models.ICredential - /// 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.DeviceRegistry.Module.Instance.GetTelemetryId.Invoke(); - if (telemetryId != "" && telemetryId != "internal") - { - __correlationId = telemetryId; - } - Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); - if (Break) - { - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.AttachDebugger.Break(); - } - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.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 GetAzDeviceRegistryCredentials_GetViaIdentity() - { - - } - - /// Handles/Dispatches events during the call to the REST service. - /// The message id - /// The message cancellation token. When this call is cancelled, this should be true - /// Detailed message data for the message event. - /// - /// A that will be complete when handling of the message is completed. - /// - async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.Events.Verbose: - { - WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.Warning: - { - WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.Information: - { - var data = messageData(); - WriteInformation(data.Message, new string[]{}); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.Debug: - { - WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - __processRecordId = System.Guid.NewGuid().ToString(); - try - { - // work - using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Token) ) - { - asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); - if (null != HttpPipelinePrepend) - { - Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); - } - if (null != HttpPipelineAppend) - { - Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); - } - // get the client instance - try - { - await ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - if (InputObject?.Id != null) - { - await this.Client.CredentialsGetViaIdentity(InputObject.Id, onOk, onDefault, this, Pipeline); - } - else - { - // try to call with PATH parameters from Input Object - if (null == InputObject.SubscriptionId) - { - ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); - } - if (null == InputObject.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.NamespaceName) - { - ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.NamespaceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); - } - await this.Client.CredentialsGet(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.NamespaceName ?? null, onOk, onDefault, this, Pipeline); - } - await ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - } - catch (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletProcessRecordAsyncEnd); - } - } - } - - /// Interrupts currently running code within the command. - protected override void StopProcessing() - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Cancel(); - base.StopProcessing(); - } - - /// - new protected void WriteObject(object sendToPipeline) - { - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); - base.WriteObject(sendToPipeline); - } - - /// - /// - new protected void WriteObject(object sendToPipeline, bool enumerateCollection) - { - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.Models.ICredential - /// 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.DeviceRegistry.Models.ICredential - 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/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistryCredentials_List.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistryCredentials_List.cs deleted file mode 100644 index 42301439b63f..000000000000 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistryCredentials_List.cs +++ /dev/null @@ -1,534 +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.DeviceRegistry.Cmdlets -{ - using static Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Extensions; - using Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.PowerShell; - using Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Cmdlets; - using System; - - /// List Credential resources by Namespace - /// - /// [OpenAPI] ListByResourceGroup=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/credentials" - /// - [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzDeviceRegistryCredentials_List")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICredential))] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Description(@"List Credential resources by Namespace")] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/credentials", ApiVersion = "2025-11-01-preview")] - public partial class GetAzDeviceRegistryCredentials_List : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener, - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.DeviceRegistry Client => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.ParameterCategory.Runtime)] - public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.ParameterCategory.Runtime)] - public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } - - /// Accessor for our copy of the InvocationInfo. - public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } - - /// - /// cancellation delegate. Stops the cmdlet when called. - /// - global::System.Action Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; - - /// cancellation token. - global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener.Token => _cancellationTokenSource.Token; - - /// Backing field for property. - private string _namespaceName; - - /// The name of the namespace. - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the namespace.")] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The name of the namespace.", - SerializedName = @"namespaceName", - PossibleTypes = new [] { typeof(string) })] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.ParameterCategory.Path)] - public string NamespaceName { get => this._namespaceName; set => this._namespaceName = value; } - - /// - /// The instance of the that the remote call will use. - /// - public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The name of the resource group. The name is case insensitive.", - SerializedName = @"resourceGroupName", - PossibleTypes = new [] { typeof(string) })] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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. The value must be an UUID. - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription. The value must be an UUID.")] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The ID of the target subscription. The value must be an UUID.", - SerializedName = @"subscriptionId", - PossibleTypes = new [] { typeof(string) })] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.DefaultInfo( - Name = @"", - Description =@"", - Script = @"(Get-AzContext).Subscription.Id", - SetCondition = @"")] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.Models.ICredentialListResult - /// 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.DeviceRegistry.Module.Instance.GetTelemetryId.Invoke(); - if (telemetryId != "" && telemetryId != "internal") - { - __correlationId = telemetryId; - } - Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); - if (Break) - { - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.AttachDebugger.Break(); - } - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.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 GetAzDeviceRegistryCredentials_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.DeviceRegistry.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.DeviceRegistry.Runtime.Events.Verbose: - { - WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.Warning: - { - WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.Information: - { - var data = messageData(); - WriteInformation(data.Message, new string[]{}); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.Debug: - { - WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - __processRecordId = System.Guid.NewGuid().ToString(); - try - { - // work - using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Token) ) - { - asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); - if (null != HttpPipelinePrepend) - { - Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); - } - if (null != HttpPipelineAppend) - { - Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); - } - // get the client instance - try - { - foreach( var SubscriptionId in this.SubscriptionId ) - { - await ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.CredentialsListByResourceGroup(SubscriptionId, ResourceGroupName, NamespaceName, onOk, onDefault, this, Pipeline); - await ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - } - } - catch (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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,NamespaceName=NamespaceName}) - { - ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } - }); - } - finally - { - await ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletProcessRecordAsyncEnd); - } - } - } - - /// Interrupts currently running code within the command. - protected override void StopProcessing() - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Cancel(); - base.StopProcessing(); - } - - /// - new protected void WriteObject(object sendToPipeline) - { - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); - base.WriteObject(sendToPipeline); - } - - /// - /// - new protected void WriteObject(object sendToPipeline, bool enumerateCollection) - { - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.Models.ICredentialListResult - /// 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.DeviceRegistry.Models.ICredentialListResult - 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.DeviceRegistry.Runtime.Method.Get ); - await ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.FollowingNextLink); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.CredentialsListByResourceGroup_Call(requestMessage, onOk, onDefault, this, Pipeline); - } - } - } - } - } - } -} \ No newline at end of file diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistryNamespaceAsset_Get.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistryNamespaceAsset_Get.cs index 62916afed5fa..ae1105331a13 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistryNamespaceAsset_Get.cs +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistryNamespaceAsset_Get.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceAsset))] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Description(@"Get a NamespaceAsset")] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/assets/{assetName}", ApiVersion = "2025-11-01-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/assets/{assetName}", ApiVersion = "2025-10-01")] public partial class GetAzDeviceRegistryNamespaceAsset_Get : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IContext diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistryNamespaceAsset_GetViaIdentity.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistryNamespaceAsset_GetViaIdentity.cs index 0ec3ce4b4789..a7714760da27 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistryNamespaceAsset_GetViaIdentity.cs +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistryNamespaceAsset_GetViaIdentity.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceAsset))] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Description(@"Get a NamespaceAsset")] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/assets/{assetName}", ApiVersion = "2025-11-01-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/assets/{assetName}", ApiVersion = "2025-10-01")] public partial class GetAzDeviceRegistryNamespaceAsset_GetViaIdentity : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IContext diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistryNamespaceAsset_GetViaIdentityNamespace.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistryNamespaceAsset_GetViaIdentityNamespace.cs index 038ff53c07e4..ce7a0d54a0cc 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistryNamespaceAsset_GetViaIdentityNamespace.cs +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistryNamespaceAsset_GetViaIdentityNamespace.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceAsset))] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Description(@"Get a NamespaceAsset")] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/assets/{assetName}", ApiVersion = "2025-11-01-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/assets/{assetName}", ApiVersion = "2025-10-01")] public partial class GetAzDeviceRegistryNamespaceAsset_GetViaIdentityNamespace : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IContext diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistryNamespaceAsset_List.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistryNamespaceAsset_List.cs index bd02a8a74b87..a5b4846202f0 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistryNamespaceAsset_List.cs +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistryNamespaceAsset_List.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceAsset))] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Description(@"List NamespaceAsset resources by Namespace")] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/assets", ApiVersion = "2025-11-01-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/assets", ApiVersion = "2025-10-01")] public partial class GetAzDeviceRegistryNamespaceAsset_List : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IContext diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistryNamespaceDevice_Get.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistryNamespaceDevice_Get.cs index 6ce7042ab315..d1e5e4ae7a4c 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistryNamespaceDevice_Get.cs +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistryNamespaceDevice_Get.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDevice))] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Description(@"Get a NamespaceDevice")] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/devices/{deviceName}", ApiVersion = "2025-11-01-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/devices/{deviceName}", ApiVersion = "2025-10-01")] public partial class GetAzDeviceRegistryNamespaceDevice_Get : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IContext diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistryNamespaceDevice_GetViaIdentity.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistryNamespaceDevice_GetViaIdentity.cs index 214e6b4d095a..7813e8f46494 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistryNamespaceDevice_GetViaIdentity.cs +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistryNamespaceDevice_GetViaIdentity.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDevice))] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Description(@"Get a NamespaceDevice")] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/devices/{deviceName}", ApiVersion = "2025-11-01-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/devices/{deviceName}", ApiVersion = "2025-10-01")] public partial class GetAzDeviceRegistryNamespaceDevice_GetViaIdentity : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IContext diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistryNamespaceDevice_GetViaIdentityNamespace.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistryNamespaceDevice_GetViaIdentityNamespace.cs index b0d2b3518e7f..d13f8d594523 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistryNamespaceDevice_GetViaIdentityNamespace.cs +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistryNamespaceDevice_GetViaIdentityNamespace.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDevice))] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Description(@"Get a NamespaceDevice")] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/devices/{deviceName}", ApiVersion = "2025-11-01-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/devices/{deviceName}", ApiVersion = "2025-10-01")] public partial class GetAzDeviceRegistryNamespaceDevice_GetViaIdentityNamespace : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IContext diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistryNamespaceDevice_List.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistryNamespaceDevice_List.cs index fd0d07b718da..0ca8c334bfbc 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistryNamespaceDevice_List.cs +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistryNamespaceDevice_List.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDevice))] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Description(@"List NamespaceDevice resources by Namespace")] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/devices", ApiVersion = "2025-11-01-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/devices", ApiVersion = "2025-10-01")] public partial class GetAzDeviceRegistryNamespaceDevice_List : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IContext diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistryNamespaceDiscoveredAsset_Get.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistryNamespaceDiscoveredAsset_Get.cs index 036b1200dd85..ad4a1f52e6fb 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistryNamespaceDiscoveredAsset_Get.cs +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistryNamespaceDiscoveredAsset_Get.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDiscoveredAsset))] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Description(@"Get a NamespaceDiscoveredAsset")] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/discoveredAssets/{discoveredAssetName}", ApiVersion = "2025-11-01-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/discoveredAssets/{discoveredAssetName}", ApiVersion = "2025-10-01")] public partial class GetAzDeviceRegistryNamespaceDiscoveredAsset_Get : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IContext diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistryNamespaceDiscoveredAsset_GetViaIdentity.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistryNamespaceDiscoveredAsset_GetViaIdentity.cs index 2372701c05c8..99e597ee508a 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistryNamespaceDiscoveredAsset_GetViaIdentity.cs +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistryNamespaceDiscoveredAsset_GetViaIdentity.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDiscoveredAsset))] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Description(@"Get a NamespaceDiscoveredAsset")] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/discoveredAssets/{discoveredAssetName}", ApiVersion = "2025-11-01-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/discoveredAssets/{discoveredAssetName}", ApiVersion = "2025-10-01")] public partial class GetAzDeviceRegistryNamespaceDiscoveredAsset_GetViaIdentity : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IContext diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistryNamespaceDiscoveredAsset_GetViaIdentityNamespace.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistryNamespaceDiscoveredAsset_GetViaIdentityNamespace.cs index c521cfea6b13..8c5b757b5a85 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistryNamespaceDiscoveredAsset_GetViaIdentityNamespace.cs +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistryNamespaceDiscoveredAsset_GetViaIdentityNamespace.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDiscoveredAsset))] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Description(@"Get a NamespaceDiscoveredAsset")] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/discoveredAssets/{discoveredAssetName}", ApiVersion = "2025-11-01-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/discoveredAssets/{discoveredAssetName}", ApiVersion = "2025-10-01")] public partial class GetAzDeviceRegistryNamespaceDiscoveredAsset_GetViaIdentityNamespace : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IContext diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistryNamespaceDiscoveredAsset_List.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistryNamespaceDiscoveredAsset_List.cs index df34c31a2fd9..41753cb8979a 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistryNamespaceDiscoveredAsset_List.cs +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistryNamespaceDiscoveredAsset_List.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDiscoveredAsset))] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Description(@"List NamespaceDiscoveredAsset resources by Namespace")] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/discoveredAssets", ApiVersion = "2025-11-01-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/discoveredAssets", ApiVersion = "2025-10-01")] public partial class GetAzDeviceRegistryNamespaceDiscoveredAsset_List : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IContext diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistryNamespaceDiscoveredDevice_Get.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistryNamespaceDiscoveredDevice_Get.cs index 4ec1d11ad50d..8d9ca738f6a0 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistryNamespaceDiscoveredDevice_Get.cs +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistryNamespaceDiscoveredDevice_Get.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDiscoveredDevice))] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Description(@"Get a NamespaceDiscoveredDevice")] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/discoveredDevices/{discoveredDeviceName}", ApiVersion = "2025-11-01-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/discoveredDevices/{discoveredDeviceName}", ApiVersion = "2025-10-01")] public partial class GetAzDeviceRegistryNamespaceDiscoveredDevice_Get : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IContext diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistryNamespaceDiscoveredDevice_GetViaIdentity.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistryNamespaceDiscoveredDevice_GetViaIdentity.cs index 11e2882d7a18..74b3b09f6e75 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistryNamespaceDiscoveredDevice_GetViaIdentity.cs +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistryNamespaceDiscoveredDevice_GetViaIdentity.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDiscoveredDevice))] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Description(@"Get a NamespaceDiscoveredDevice")] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/discoveredDevices/{discoveredDeviceName}", ApiVersion = "2025-11-01-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/discoveredDevices/{discoveredDeviceName}", ApiVersion = "2025-10-01")] public partial class GetAzDeviceRegistryNamespaceDiscoveredDevice_GetViaIdentity : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IContext diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistryNamespaceDiscoveredDevice_GetViaIdentityNamespace.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistryNamespaceDiscoveredDevice_GetViaIdentityNamespace.cs index 0ec53222c4a4..4dcce3837d87 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistryNamespaceDiscoveredDevice_GetViaIdentityNamespace.cs +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistryNamespaceDiscoveredDevice_GetViaIdentityNamespace.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDiscoveredDevice))] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Description(@"Get a NamespaceDiscoveredDevice")] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/discoveredDevices/{discoveredDeviceName}", ApiVersion = "2025-11-01-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/discoveredDevices/{discoveredDeviceName}", ApiVersion = "2025-10-01")] public partial class GetAzDeviceRegistryNamespaceDiscoveredDevice_GetViaIdentityNamespace : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IContext diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistryNamespaceDiscoveredDevice_List.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistryNamespaceDiscoveredDevice_List.cs index 77be478b3010..8f19321b27aa 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistryNamespaceDiscoveredDevice_List.cs +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistryNamespaceDiscoveredDevice_List.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDiscoveredDevice))] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Description(@"List NamespaceDiscoveredDevice resources by Namespace")] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/discoveredDevices", ApiVersion = "2025-11-01-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/discoveredDevices", ApiVersion = "2025-10-01")] public partial class GetAzDeviceRegistryNamespaceDiscoveredDevice_List : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IContext diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistryNamespace_Get.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistryNamespace_Get.cs index 5ebb099da8df..87fefb4e2681 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistryNamespace_Get.cs +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistryNamespace_Get.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespace))] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Description(@"Get a Namespace")] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}", ApiVersion = "2025-11-01-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}", ApiVersion = "2025-10-01")] public partial class GetAzDeviceRegistryNamespace_Get : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IContext diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistryNamespace_GetViaIdentity.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistryNamespace_GetViaIdentity.cs index 44808f28da6a..7288eaea3fe2 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistryNamespace_GetViaIdentity.cs +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistryNamespace_GetViaIdentity.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespace))] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Description(@"Get a Namespace")] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}", ApiVersion = "2025-11-01-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}", ApiVersion = "2025-10-01")] public partial class GetAzDeviceRegistryNamespace_GetViaIdentity : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IContext diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistryNamespace_List.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistryNamespace_List.cs index 5d622d6299cc..60c3eb3ed73c 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistryNamespace_List.cs +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistryNamespace_List.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespace))] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Description(@"List Namespace resources by subscription ID")] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/providers/Microsoft.DeviceRegistry/namespaces", ApiVersion = "2025-11-01-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/providers/Microsoft.DeviceRegistry/namespaces", ApiVersion = "2025-10-01")] public partial class GetAzDeviceRegistryNamespace_List : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IContext diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistryNamespace_List1.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistryNamespace_List1.cs index 4dc2d6fe274a..5cecb4359add 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistryNamespace_List1.cs +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistryNamespace_List1.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespace))] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Description(@"List Namespace resources by resource group")] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces", ApiVersion = "2025-11-01-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces", ApiVersion = "2025-10-01")] public partial class GetAzDeviceRegistryNamespace_List1 : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IContext diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistryOperation_List.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistryOperation_List.cs index 9e9d6252d6fd..ea68270da9a1 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistryOperation_List.cs +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistryOperation_List.cs @@ -19,7 +19,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IOperation))] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Description(@"List the operations for the provider")] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/providers/Microsoft.DeviceRegistry/operations", ApiVersion = "2025-11-01-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/providers/Microsoft.DeviceRegistry/operations", ApiVersion = "2025-10-01")] public partial class GetAzDeviceRegistryOperation_List : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IContext diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistryPolicy_Get.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistryPolicy_Get.cs deleted file mode 100644 index ad877a6fb300..000000000000 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistryPolicy_Get.cs +++ /dev/null @@ -1,522 +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.DeviceRegistry.Cmdlets -{ - using static Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Extensions; - using Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.PowerShell; - using Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Cmdlets; - using System; - - /// Get a Policy - /// - /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/credentials/default/policies/{policyName}" - /// - [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzDeviceRegistryPolicy_Get")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicy))] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Description(@"Get a Policy")] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/credentials/default/policies/{policyName}", ApiVersion = "2025-11-01-preview")] - public partial class GetAzDeviceRegistryPolicy_Get : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener, - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.DeviceRegistry Client => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.ParameterCategory.Runtime)] - public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.ParameterCategory.Runtime)] - public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } - - /// Accessor for our copy of the InvocationInfo. - public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } - - /// - /// cancellation delegate. Stops the cmdlet when called. - /// - global::System.Action Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; - - /// cancellation token. - global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener.Token => _cancellationTokenSource.Token; - - /// Backing field for property. - private string _name; - - /// The name of the Policy tracked resource. - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the Policy tracked resource.")] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The name of the Policy tracked resource.", - SerializedName = @"policyName", - PossibleTypes = new [] { typeof(string) })] - [global::System.Management.Automation.Alias("PolicyName")] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.ParameterCategory.Path)] - public string Name { get => this._name; set => this._name = value; } - - /// Backing field for property. - private string _namespaceName; - - /// The name of the namespace. - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the namespace.")] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The name of the namespace.", - SerializedName = @"namespaceName", - PossibleTypes = new [] { typeof(string) })] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.ParameterCategory.Path)] - public string NamespaceName { get => this._namespaceName; set => this._namespaceName = value; } - - /// - /// The instance of the that the remote call will use. - /// - public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The name of the resource group. The name is case insensitive.", - SerializedName = @"resourceGroupName", - PossibleTypes = new [] { typeof(string) })] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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. The value must be an UUID. - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription. The value must be an UUID.")] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The ID of the target subscription. The value must be an UUID.", - SerializedName = @"subscriptionId", - PossibleTypes = new [] { typeof(string) })] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.DefaultInfo( - Name = @"", - Description =@"", - Script = @"(Get-AzContext).Subscription.Id", - SetCondition = @"")] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.Models.IPolicy - /// 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.DeviceRegistry.Module.Instance.GetTelemetryId.Invoke(); - if (telemetryId != "" && telemetryId != "internal") - { - __correlationId = telemetryId; - } - Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); - if (Break) - { - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.AttachDebugger.Break(); - } - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.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 GetAzDeviceRegistryPolicy_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.DeviceRegistry.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.DeviceRegistry.Runtime.Events.Verbose: - { - WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.Warning: - { - WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.Information: - { - var data = messageData(); - WriteInformation(data.Message, new string[]{}); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.Debug: - { - WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - __processRecordId = System.Guid.NewGuid().ToString(); - try - { - // work - using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Token) ) - { - asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); - if (null != HttpPipelinePrepend) - { - Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); - } - if (null != HttpPipelineAppend) - { - Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); - } - // get the client instance - try - { - foreach( var SubscriptionId in this.SubscriptionId ) - { - await ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.PoliciesGet(SubscriptionId, ResourceGroupName, NamespaceName, Name, onOk, onDefault, this, Pipeline); - await ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - } - } - catch (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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,NamespaceName=NamespaceName,Name=Name}) - { - ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } - }); - } - finally - { - await ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletProcessRecordAsyncEnd); - } - } - } - - /// Interrupts currently running code within the command. - protected override void StopProcessing() - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Cancel(); - base.StopProcessing(); - } - - /// - new protected void WriteObject(object sendToPipeline) - { - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); - base.WriteObject(sendToPipeline); - } - - /// - /// - new protected void WriteObject(object sendToPipeline, bool enumerateCollection) - { - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.Models.IPolicy - /// 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.DeviceRegistry.Models.IPolicy - 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/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistryPolicy_GetViaIdentity.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistryPolicy_GetViaIdentity.cs deleted file mode 100644 index b6e2ddfce496..000000000000 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistryPolicy_GetViaIdentity.cs +++ /dev/null @@ -1,489 +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.DeviceRegistry.Cmdlets -{ - using static Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Extensions; - using Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.PowerShell; - using Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Cmdlets; - using System; - - /// Get a Policy - /// - /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/credentials/default/policies/{policyName}" - /// - [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzDeviceRegistryPolicy_GetViaIdentity")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicy))] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Description(@"Get a Policy")] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/credentials/default/policies/{policyName}", ApiVersion = "2025-11-01-preview")] - public partial class GetAzDeviceRegistryPolicy_GetViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener, - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.DeviceRegistry Client => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.ParameterCategory.Runtime)] - public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.ParameterCategory.Runtime)] - public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IDeviceRegistryIdentity _inputObject; - - /// Identity Parameter - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.ParameterCategory.Path)] - public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IDeviceRegistryIdentity 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.DeviceRegistry.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; - - /// cancellation token. - global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener.Token => _cancellationTokenSource.Token; - - /// - /// The instance of the that the remote call will use. - /// - public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.Models.IPolicy - /// 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.DeviceRegistry.Module.Instance.GetTelemetryId.Invoke(); - if (telemetryId != "" && telemetryId != "internal") - { - __correlationId = telemetryId; - } - Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); - if (Break) - { - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.AttachDebugger.Break(); - } - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.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 GetAzDeviceRegistryPolicy_GetViaIdentity() - { - - } - - /// Handles/Dispatches events during the call to the REST service. - /// The message id - /// The message cancellation token. When this call is cancelled, this should be true - /// Detailed message data for the message event. - /// - /// A that will be complete when handling of the message is completed. - /// - async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.Events.Verbose: - { - WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.Warning: - { - WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.Information: - { - var data = messageData(); - WriteInformation(data.Message, new string[]{}); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.Debug: - { - WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - __processRecordId = System.Guid.NewGuid().ToString(); - try - { - // work - using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Token) ) - { - asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); - if (null != HttpPipelinePrepend) - { - Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); - } - if (null != HttpPipelineAppend) - { - Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); - } - // get the client instance - try - { - await ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - if (InputObject?.Id != null) - { - await this.Client.PoliciesGetViaIdentity(InputObject.Id, onOk, onDefault, this, Pipeline); - } - else - { - // try to call with PATH parameters from Input Object - if (null == InputObject.SubscriptionId) - { - ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); - } - if (null == InputObject.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.NamespaceName) - { - ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.NamespaceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); - } - if (null == InputObject.PolicyName) - { - ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.PolicyName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); - } - await this.Client.PoliciesGet(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.NamespaceName ?? null, InputObject.PolicyName ?? null, onOk, onDefault, this, Pipeline); - } - await ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - } - catch (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletProcessRecordAsyncEnd); - } - } - } - - /// Interrupts currently running code within the command. - protected override void StopProcessing() - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Cancel(); - base.StopProcessing(); - } - - /// - new protected void WriteObject(object sendToPipeline) - { - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); - base.WriteObject(sendToPipeline); - } - - /// - /// - new protected void WriteObject(object sendToPipeline, bool enumerateCollection) - { - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.Models.IPolicy - /// 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.DeviceRegistry.Models.IPolicy - 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/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistryPolicy_GetViaIdentityNamespace.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistryPolicy_GetViaIdentityNamespace.cs deleted file mode 100644 index fbe2d3742355..000000000000 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistryPolicy_GetViaIdentityNamespace.cs +++ /dev/null @@ -1,501 +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.DeviceRegistry.Cmdlets -{ - using static Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Extensions; - using Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.PowerShell; - using Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Cmdlets; - using System; - - /// Get a Policy - /// - /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/credentials/default/policies/{policyName}" - /// - [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzDeviceRegistryPolicy_GetViaIdentityNamespace")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicy))] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Description(@"Get a Policy")] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/credentials/default/policies/{policyName}", ApiVersion = "2025-11-01-preview")] - public partial class GetAzDeviceRegistryPolicy_GetViaIdentityNamespace : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener, - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.DeviceRegistry Client => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.ParameterCategory.Runtime)] - public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.ParameterCategory.Runtime)] - public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } - - /// Accessor for our copy of the InvocationInfo. - public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } - - /// - /// cancellation delegate. Stops the cmdlet when called. - /// - global::System.Action Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; - - /// cancellation token. - global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener.Token => _cancellationTokenSource.Token; - - /// Backing field for property. - private string _name; - - /// The name of the Policy tracked resource. - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the Policy tracked resource.")] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The name of the Policy tracked resource.", - SerializedName = @"policyName", - PossibleTypes = new [] { typeof(string) })] - [global::System.Management.Automation.Alias("PolicyName")] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.ParameterCategory.Path)] - public string Name { get => this._name; set => this._name = value; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IDeviceRegistryIdentity _namespaceInputObject; - - /// Identity Parameter - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.ParameterCategory.Path)] - public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IDeviceRegistryIdentity NamespaceInputObject { get => this._namespaceInputObject; set => this._namespaceInputObject = value; } - - /// - /// The instance of the that the remote call will use. - /// - public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.Models.IPolicy - /// 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.DeviceRegistry.Module.Instance.GetTelemetryId.Invoke(); - if (telemetryId != "" && telemetryId != "internal") - { - __correlationId = telemetryId; - } - Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); - if (Break) - { - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.AttachDebugger.Break(); - } - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.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 GetAzDeviceRegistryPolicy_GetViaIdentityNamespace() - { - - } - - /// 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.DeviceRegistry.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.DeviceRegistry.Runtime.Events.Verbose: - { - WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.Warning: - { - WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.Information: - { - var data = messageData(); - WriteInformation(data.Message, new string[]{}); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.Debug: - { - WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - __processRecordId = System.Guid.NewGuid().ToString(); - try - { - // work - using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Token) ) - { - asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); - if (null != HttpPipelinePrepend) - { - Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); - } - if (null != HttpPipelineAppend) - { - Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); - } - // get the client instance - try - { - await ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - if (NamespaceInputObject?.Id != null) - { - this.NamespaceInputObject.Id += $"/policies/{(global::System.Uri.EscapeDataString(this.Name.ToString()))}"; - await this.Client.PoliciesGetViaIdentity(NamespaceInputObject.Id, onOk, onDefault, this, Pipeline); - } - else - { - // try to call with PATH parameters from Input Object - if (null == NamespaceInputObject.SubscriptionId) - { - ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("NamespaceInputObject has null value for NamespaceInputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, NamespaceInputObject) ); - } - if (null == NamespaceInputObject.ResourceGroupName) - { - ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("NamespaceInputObject has null value for NamespaceInputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, NamespaceInputObject) ); - } - if (null == NamespaceInputObject.NamespaceName) - { - ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("NamespaceInputObject has null value for NamespaceInputObject.NamespaceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, NamespaceInputObject) ); - } - await this.Client.PoliciesGet(NamespaceInputObject.SubscriptionId ?? null, NamespaceInputObject.ResourceGroupName ?? null, NamespaceInputObject.NamespaceName ?? null, Name, onOk, onDefault, this, Pipeline); - } - await ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - } - catch (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.UndeclaredResponseException urexception) - { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Name=Name}) - { - ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } - }); - } - finally - { - await ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletProcessRecordAsyncEnd); - } - } - } - - /// Interrupts currently running code within the command. - protected override void StopProcessing() - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Cancel(); - base.StopProcessing(); - } - - /// - new protected void WriteObject(object sendToPipeline) - { - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); - base.WriteObject(sendToPipeline); - } - - /// - /// - new protected void WriteObject(object sendToPipeline, bool enumerateCollection) - { - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.Models.IPolicy - /// 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.DeviceRegistry.Models.IPolicy - 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/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistryPolicy_List.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistryPolicy_List.cs deleted file mode 100644 index b965df8b416c..000000000000 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistryPolicy_List.cs +++ /dev/null @@ -1,534 +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.DeviceRegistry.Cmdlets -{ - using static Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Extensions; - using Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.PowerShell; - using Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Cmdlets; - using System; - - /// List Policy resources by Credential - /// - /// [OpenAPI] ListByResourceGroup=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/credentials/default/policies" - /// - [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzDeviceRegistryPolicy_List")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicy))] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Description(@"List Policy resources by Credential")] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/credentials/default/policies", ApiVersion = "2025-11-01-preview")] - public partial class GetAzDeviceRegistryPolicy_List : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener, - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.DeviceRegistry Client => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.ParameterCategory.Runtime)] - public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.ParameterCategory.Runtime)] - public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } - - /// Accessor for our copy of the InvocationInfo. - public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } - - /// - /// cancellation delegate. Stops the cmdlet when called. - /// - global::System.Action Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; - - /// cancellation token. - global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener.Token => _cancellationTokenSource.Token; - - /// Backing field for property. - private string _namespaceName; - - /// The name of the namespace. - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the namespace.")] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The name of the namespace.", - SerializedName = @"namespaceName", - PossibleTypes = new [] { typeof(string) })] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.ParameterCategory.Path)] - public string NamespaceName { get => this._namespaceName; set => this._namespaceName = value; } - - /// - /// The instance of the that the remote call will use. - /// - public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The name of the resource group. The name is case insensitive.", - SerializedName = @"resourceGroupName", - PossibleTypes = new [] { typeof(string) })] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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. The value must be an UUID. - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription. The value must be an UUID.")] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The ID of the target subscription. The value must be an UUID.", - SerializedName = @"subscriptionId", - PossibleTypes = new [] { typeof(string) })] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.DefaultInfo( - Name = @"", - Description =@"", - Script = @"(Get-AzContext).Subscription.Id", - SetCondition = @"")] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.Models.IPolicyListResult - /// 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.DeviceRegistry.Module.Instance.GetTelemetryId.Invoke(); - if (telemetryId != "" && telemetryId != "internal") - { - __correlationId = telemetryId; - } - Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); - if (Break) - { - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.AttachDebugger.Break(); - } - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.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 GetAzDeviceRegistryPolicy_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.DeviceRegistry.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.DeviceRegistry.Runtime.Events.Verbose: - { - WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.Warning: - { - WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.Information: - { - var data = messageData(); - WriteInformation(data.Message, new string[]{}); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.Debug: - { - WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - __processRecordId = System.Guid.NewGuid().ToString(); - try - { - // work - using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Token) ) - { - asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); - if (null != HttpPipelinePrepend) - { - Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); - } - if (null != HttpPipelineAppend) - { - Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); - } - // get the client instance - try - { - foreach( var SubscriptionId in this.SubscriptionId ) - { - await ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.PoliciesListByResourceGroup(SubscriptionId, ResourceGroupName, NamespaceName, onOk, onDefault, this, Pipeline); - await ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - } - } - catch (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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,NamespaceName=NamespaceName}) - { - ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } - }); - } - finally - { - await ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletProcessRecordAsyncEnd); - } - } - } - - /// Interrupts currently running code within the command. - protected override void StopProcessing() - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Cancel(); - base.StopProcessing(); - } - - /// - new protected void WriteObject(object sendToPipeline) - { - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); - base.WriteObject(sendToPipeline); - } - - /// - /// - new protected void WriteObject(object sendToPipeline, bool enumerateCollection) - { - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.Models.IPolicyListResult - /// 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.DeviceRegistry.Models.IPolicyListResult - 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.DeviceRegistry.Runtime.Method.Get ); - await ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.FollowingNextLink); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.PoliciesListByResourceGroup_Call(requestMessage, onOk, onDefault, this, Pipeline); - } - } - } - } - } - } -} \ No newline at end of file diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistrySchemaRegistry_Get.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistrySchemaRegistry_Get.cs index 8d395826776e..ec2c820807b8 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistrySchemaRegistry_Get.cs +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistrySchemaRegistry_Get.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ISchemaRegistry))] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Description(@"Get a SchemaRegistry")] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}", ApiVersion = "2025-11-01-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}", ApiVersion = "2025-10-01")] public partial class GetAzDeviceRegistrySchemaRegistry_Get : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IContext diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistrySchemaRegistry_GetViaIdentity.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistrySchemaRegistry_GetViaIdentity.cs index af0cc8932f39..b9fdc73a3841 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistrySchemaRegistry_GetViaIdentity.cs +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistrySchemaRegistry_GetViaIdentity.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ISchemaRegistry))] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Description(@"Get a SchemaRegistry")] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}", ApiVersion = "2025-11-01-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}", ApiVersion = "2025-10-01")] public partial class GetAzDeviceRegistrySchemaRegistry_GetViaIdentity : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IContext diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistrySchemaRegistry_List.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistrySchemaRegistry_List.cs index 55d997347157..25ae5b41aefd 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistrySchemaRegistry_List.cs +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistrySchemaRegistry_List.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ISchemaRegistry))] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Description(@"List SchemaRegistry resources by subscription ID")] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/providers/Microsoft.DeviceRegistry/schemaRegistries", ApiVersion = "2025-11-01-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/providers/Microsoft.DeviceRegistry/schemaRegistries", ApiVersion = "2025-10-01")] public partial class GetAzDeviceRegistrySchemaRegistry_List : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IContext diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistrySchemaRegistry_List1.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistrySchemaRegistry_List1.cs index 71b5605f7591..f89084a0c703 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistrySchemaRegistry_List1.cs +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistrySchemaRegistry_List1.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ISchemaRegistry))] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Description(@"List SchemaRegistry resources by resource group")] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries", ApiVersion = "2025-11-01-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries", ApiVersion = "2025-10-01")] public partial class GetAzDeviceRegistrySchemaRegistry_List1 : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IContext diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistrySchemaVersion_Get.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistrySchemaVersion_Get.cs index 215ae202eca2..3c9f2b8684b6 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistrySchemaVersion_Get.cs +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistrySchemaVersion_Get.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ISchemaVersion))] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Description(@"Get a SchemaVersion")] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}/schemas/{schemaName}/schemaVersions/{schemaVersionName}", ApiVersion = "2025-11-01-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}/schemas/{schemaName}/schemaVersions/{schemaVersionName}", ApiVersion = "2025-10-01")] public partial class GetAzDeviceRegistrySchemaVersion_Get : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IContext diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistrySchemaVersion_GetViaIdentity.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistrySchemaVersion_GetViaIdentity.cs index f9a9dcfa3fd4..4c3126e65e25 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistrySchemaVersion_GetViaIdentity.cs +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistrySchemaVersion_GetViaIdentity.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ISchemaVersion))] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Description(@"Get a SchemaVersion")] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}/schemas/{schemaName}/schemaVersions/{schemaVersionName}", ApiVersion = "2025-11-01-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}/schemas/{schemaName}/schemaVersions/{schemaVersionName}", ApiVersion = "2025-10-01")] public partial class GetAzDeviceRegistrySchemaVersion_GetViaIdentity : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IContext diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistrySchemaVersion_GetViaIdentitySchema.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistrySchemaVersion_GetViaIdentitySchema.cs index 3607fd5b88dd..c95240c9d8ac 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistrySchemaVersion_GetViaIdentitySchema.cs +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistrySchemaVersion_GetViaIdentitySchema.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ISchemaVersion))] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Description(@"Get a SchemaVersion")] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}/schemas/{schemaName}/schemaVersions/{schemaVersionName}", ApiVersion = "2025-11-01-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}/schemas/{schemaName}/schemaVersions/{schemaVersionName}", ApiVersion = "2025-10-01")] public partial class GetAzDeviceRegistrySchemaVersion_GetViaIdentitySchema : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IContext diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistrySchemaVersion_GetViaIdentitySchemaRegistry.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistrySchemaVersion_GetViaIdentitySchemaRegistry.cs index db128d627898..ef1c697e2ef5 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistrySchemaVersion_GetViaIdentitySchemaRegistry.cs +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistrySchemaVersion_GetViaIdentitySchemaRegistry.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ISchemaVersion))] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Description(@"Get a SchemaVersion")] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}/schemas/{schemaName}/schemaVersions/{schemaVersionName}", ApiVersion = "2025-11-01-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}/schemas/{schemaName}/schemaVersions/{schemaVersionName}", ApiVersion = "2025-10-01")] public partial class GetAzDeviceRegistrySchemaVersion_GetViaIdentitySchemaRegistry : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IContext diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistrySchemaVersion_List.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistrySchemaVersion_List.cs index 604592cef40a..e037a54e2465 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistrySchemaVersion_List.cs +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistrySchemaVersion_List.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ISchemaVersion))] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Description(@"List SchemaVersion resources by Schema")] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}/schemas/{schemaName}/schemaVersions", ApiVersion = "2025-11-01-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}/schemas/{schemaName}/schemaVersions", ApiVersion = "2025-10-01")] public partial class GetAzDeviceRegistrySchemaVersion_List : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IContext diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistrySchema_Get.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistrySchema_Get.cs index 71911231ddc1..1a0a01a4a5fd 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistrySchema_Get.cs +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistrySchema_Get.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ISchema))] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Description(@"Get a Schema")] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}/schemas/{schemaName}", ApiVersion = "2025-11-01-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}/schemas/{schemaName}", ApiVersion = "2025-10-01")] public partial class GetAzDeviceRegistrySchema_Get : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IContext diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistrySchema_GetViaIdentity.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistrySchema_GetViaIdentity.cs index fc0df6b42db8..40a0eb5dd109 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistrySchema_GetViaIdentity.cs +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistrySchema_GetViaIdentity.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ISchema))] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Description(@"Get a Schema")] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}/schemas/{schemaName}", ApiVersion = "2025-11-01-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}/schemas/{schemaName}", ApiVersion = "2025-10-01")] public partial class GetAzDeviceRegistrySchema_GetViaIdentity : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IContext diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistrySchema_GetViaIdentitySchemaRegistry.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistrySchema_GetViaIdentitySchemaRegistry.cs index 8dac20aad4f6..2c18b8a0746e 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistrySchema_GetViaIdentitySchemaRegistry.cs +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistrySchema_GetViaIdentitySchemaRegistry.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ISchema))] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Description(@"Get a Schema")] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}/schemas/{schemaName}", ApiVersion = "2025-11-01-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}/schemas/{schemaName}", ApiVersion = "2025-10-01")] public partial class GetAzDeviceRegistrySchema_GetViaIdentitySchemaRegistry : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IContext diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistrySchema_List.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistrySchema_List.cs index c2f7ffa77339..d94752bd8be5 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistrySchema_List.cs +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/GetAzDeviceRegistrySchema_List.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ISchema))] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Description(@"List Schema resources by SchemaRegistry")] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}/schemas", ApiVersion = "2025-11-01-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}/schemas", ApiVersion = "2025-10-01")] public partial class GetAzDeviceRegistrySchema_List : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IContext diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/MoveAzDeviceRegistryNamespace_Migrate.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/MoveAzDeviceRegistryNamespace_Migrate.cs index c7cae314f253..cc2d10b8c6cf 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/MoveAzDeviceRegistryNamespace_Migrate.cs +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/MoveAzDeviceRegistryNamespace_Migrate.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceMigrateResponse))] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Description(@"Migrate the resources into Namespace")] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/migrate", ApiVersion = "2025-11-01-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/migrate", ApiVersion = "2025-10-01")] public partial class MoveAzDeviceRegistryNamespace_Migrate : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IContext diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/MoveAzDeviceRegistryNamespace_MigrateExpanded.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/MoveAzDeviceRegistryNamespace_MigrateExpanded.cs index 4a101996b85a..1df50cfc8e41 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/MoveAzDeviceRegistryNamespace_MigrateExpanded.cs +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/MoveAzDeviceRegistryNamespace_MigrateExpanded.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceMigrateResponse))] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Description(@"Migrate the resources into Namespace")] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/migrate", ApiVersion = "2025-11-01-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/migrate", ApiVersion = "2025-10-01")] public partial class MoveAzDeviceRegistryNamespace_MigrateExpanded : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IContext diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/MoveAzDeviceRegistryNamespace_MigrateViaIdentity.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/MoveAzDeviceRegistryNamespace_MigrateViaIdentity.cs index 8f0508593432..714bb481d0e5 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/MoveAzDeviceRegistryNamespace_MigrateViaIdentity.cs +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/MoveAzDeviceRegistryNamespace_MigrateViaIdentity.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceMigrateResponse))] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Description(@"Migrate the resources into Namespace")] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/migrate", ApiVersion = "2025-11-01-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/migrate", ApiVersion = "2025-10-01")] public partial class MoveAzDeviceRegistryNamespace_MigrateViaIdentity : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IContext diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/MoveAzDeviceRegistryNamespace_MigrateViaIdentityExpanded.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/MoveAzDeviceRegistryNamespace_MigrateViaIdentityExpanded.cs index 699502e8294b..1f50d87aada6 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/MoveAzDeviceRegistryNamespace_MigrateViaIdentityExpanded.cs +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/MoveAzDeviceRegistryNamespace_MigrateViaIdentityExpanded.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceMigrateResponse))] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Description(@"Migrate the resources into Namespace")] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/migrate", ApiVersion = "2025-11-01-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/migrate", ApiVersion = "2025-10-01")] public partial class MoveAzDeviceRegistryNamespace_MigrateViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IContext diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/MoveAzDeviceRegistryNamespace_MigrateViaJsonFilePath.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/MoveAzDeviceRegistryNamespace_MigrateViaJsonFilePath.cs index 0ea279905586..1978dcfd4b87 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/MoveAzDeviceRegistryNamespace_MigrateViaJsonFilePath.cs +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/MoveAzDeviceRegistryNamespace_MigrateViaJsonFilePath.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceMigrateResponse))] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Description(@"Migrate the resources into Namespace")] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/migrate", ApiVersion = "2025-11-01-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/migrate", ApiVersion = "2025-10-01")] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.NotSuggestDefaultParameterSet] public partial class MoveAzDeviceRegistryNamespace_MigrateViaJsonFilePath : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener, diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/MoveAzDeviceRegistryNamespace_MigrateViaJsonString.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/MoveAzDeviceRegistryNamespace_MigrateViaJsonString.cs index 5295fea2dd3d..423b04cce158 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/MoveAzDeviceRegistryNamespace_MigrateViaJsonString.cs +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/MoveAzDeviceRegistryNamespace_MigrateViaJsonString.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceMigrateResponse))] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Description(@"Migrate the resources into Namespace")] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/migrate", ApiVersion = "2025-11-01-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/migrate", ApiVersion = "2025-10-01")] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.NotSuggestDefaultParameterSet] public partial class MoveAzDeviceRegistryNamespace_MigrateViaJsonString : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener, diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/NewAzDeviceRegistryAssetEndpointProfile_CreateExpanded.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/NewAzDeviceRegistryAssetEndpointProfile_CreateExpanded.cs index 51bea84a0e17..91c467f88dd1 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/NewAzDeviceRegistryAssetEndpointProfile_CreateExpanded.cs +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/NewAzDeviceRegistryAssetEndpointProfile_CreateExpanded.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetEndpointProfile))] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Description(@"create a AssetEndpointProfile")] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/assetEndpointProfiles/{assetEndpointProfileName}", ApiVersion = "2025-11-01-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/assetEndpointProfiles/{assetEndpointProfileName}", ApiVersion = "2025-10-01")] public partial class NewAzDeviceRegistryAssetEndpointProfile_CreateExpanded : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IContext diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/NewAzDeviceRegistryAssetEndpointProfile_CreateViaJsonFilePath.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/NewAzDeviceRegistryAssetEndpointProfile_CreateViaJsonFilePath.cs index 92e7b644e1e2..834181847895 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/NewAzDeviceRegistryAssetEndpointProfile_CreateViaJsonFilePath.cs +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/NewAzDeviceRegistryAssetEndpointProfile_CreateViaJsonFilePath.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetEndpointProfile))] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Description(@"create a AssetEndpointProfile")] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/assetEndpointProfiles/{assetEndpointProfileName}", ApiVersion = "2025-11-01-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/assetEndpointProfiles/{assetEndpointProfileName}", ApiVersion = "2025-10-01")] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.NotSuggestDefaultParameterSet] public partial class NewAzDeviceRegistryAssetEndpointProfile_CreateViaJsonFilePath : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener, diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/NewAzDeviceRegistryAssetEndpointProfile_CreateViaJsonString.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/NewAzDeviceRegistryAssetEndpointProfile_CreateViaJsonString.cs index 0f3b04c558a3..0fb393bedd0a 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/NewAzDeviceRegistryAssetEndpointProfile_CreateViaJsonString.cs +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/NewAzDeviceRegistryAssetEndpointProfile_CreateViaJsonString.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetEndpointProfile))] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Description(@"create a AssetEndpointProfile")] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/assetEndpointProfiles/{assetEndpointProfileName}", ApiVersion = "2025-11-01-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/assetEndpointProfiles/{assetEndpointProfileName}", ApiVersion = "2025-10-01")] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.NotSuggestDefaultParameterSet] public partial class NewAzDeviceRegistryAssetEndpointProfile_CreateViaJsonString : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener, diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/NewAzDeviceRegistryAsset_CreateExpanded.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/NewAzDeviceRegistryAsset_CreateExpanded.cs index 99928ac78f29..9ad1e02803d2 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/NewAzDeviceRegistryAsset_CreateExpanded.cs +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/NewAzDeviceRegistryAsset_CreateExpanded.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAsset))] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Description(@"create a Asset")] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/assets/{assetName}", ApiVersion = "2025-11-01-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/assets/{assetName}", ApiVersion = "2025-10-01")] public partial class NewAzDeviceRegistryAsset_CreateExpanded : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IContext diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/NewAzDeviceRegistryAsset_CreateViaJsonFilePath.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/NewAzDeviceRegistryAsset_CreateViaJsonFilePath.cs index 318f43c578e5..d09bd89396c0 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/NewAzDeviceRegistryAsset_CreateViaJsonFilePath.cs +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/NewAzDeviceRegistryAsset_CreateViaJsonFilePath.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAsset))] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Description(@"create a Asset")] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/assets/{assetName}", ApiVersion = "2025-11-01-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/assets/{assetName}", ApiVersion = "2025-10-01")] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.NotSuggestDefaultParameterSet] public partial class NewAzDeviceRegistryAsset_CreateViaJsonFilePath : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener, diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/NewAzDeviceRegistryAsset_CreateViaJsonString.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/NewAzDeviceRegistryAsset_CreateViaJsonString.cs index a5ce02fbdc3c..5b0ac134cfb4 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/NewAzDeviceRegistryAsset_CreateViaJsonString.cs +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/NewAzDeviceRegistryAsset_CreateViaJsonString.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAsset))] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Description(@"create a Asset")] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/assets/{assetName}", ApiVersion = "2025-11-01-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/assets/{assetName}", ApiVersion = "2025-10-01")] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.NotSuggestDefaultParameterSet] public partial class NewAzDeviceRegistryAsset_CreateViaJsonString : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener, diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/NewAzDeviceRegistryCredentials_CreateExpanded.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/NewAzDeviceRegistryCredentials_CreateExpanded.cs deleted file mode 100644 index 0543dfa5aa4f..000000000000 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/NewAzDeviceRegistryCredentials_CreateExpanded.cs +++ /dev/null @@ -1,585 +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.DeviceRegistry.Cmdlets -{ - using static Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Extensions; - using Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.PowerShell; - using Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Cmdlets; - using System; - - /// create a Credential - /// - /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/credentials/default" - /// - [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzDeviceRegistryCredentials_CreateExpanded", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICredential))] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Description(@"create a Credential")] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/credentials/default", ApiVersion = "2025-11-01-preview")] - public partial class NewAzDeviceRegistryCredentials_CreateExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener, - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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 Credential Resource - private Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICredential _resourceBody = new Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.Credential(); - - /// 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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.DeviceRegistry Client => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.ParameterCategory.Runtime)] - public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.ParameterCategory.Runtime)] - public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The geo-location where the resource lives", - SerializedName = @"location", - PossibleTypes = new [] { typeof(string) })] - public string Location { get => _resourceBody.Location ?? null; set => _resourceBody.Location = value; } - - /// - /// cancellation delegate. Stops the cmdlet when called. - /// - global::System.Action Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; - - /// cancellation token. - global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener.Token => _cancellationTokenSource.Token; - - /// Backing field for property. - private string _namespaceName; - - /// The name of the namespace. - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the namespace.")] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The name of the namespace.", - SerializedName = @"namespaceName", - PossibleTypes = new [] { typeof(string) })] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.ParameterCategory.Path)] - public string NamespaceName { get => this._namespaceName; set => this._namespaceName = value; } - - /// - /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue - /// asynchronously. - /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The name of the resource group. The name is case insensitive.", - SerializedName = @"resourceGroupName", - PossibleTypes = new [] { typeof(string) })] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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. The value must be an UUID. - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription. The value must be an UUID.")] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The ID of the target subscription. The value must be an UUID.", - SerializedName = @"subscriptionId", - PossibleTypes = new [] { typeof(string) })] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.DefaultInfo( - Name = @"", - Description =@"", - Script = @"(Get-AzContext).Subscription.Id", - SetCondition = @"")] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.ParameterCategory.Path)] - public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } - - /// Resource tags. - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.ExportAs(typeof(global::System.Collections.Hashtable))] - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Resource tags.")] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Resource tags.", - SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ITrackedResourceTags) })] - public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ITrackedResourceTags Tag { get => _resourceBody.Tag ?? null /* object */; set => _resourceBody.Tag = 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.DeviceRegistry.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.DeviceRegistry.Models.ICredential - /// 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.DeviceRegistry.Module.Instance.GetTelemetryId.Invoke(); - if (telemetryId != "" && telemetryId != "internal") - { - __correlationId = telemetryId; - } - Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); - if (Break) - { - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.AttachDebugger.Break(); - } - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - } - - /// Creates a duplicate instance of this cmdlet (via JSON serialization). - /// a duplicate instance of NewAzDeviceRegistryCredentials_CreateExpanded - public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Cmdlets.NewAzDeviceRegistryCredentials_CreateExpanded Clone() - { - var clone = new NewAzDeviceRegistryCredentials_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._resourceBody = this._resourceBody; - clone.SubscriptionId = this.SubscriptionId; - clone.ResourceGroupName = this.ResourceGroupName; - clone.NamespaceName = this.NamespaceName; - return clone; - } - - /// Performs clean-up after the command execution - protected override void EndProcessing() - { - var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.Runtime.Events.Verbose: - { - WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.Warning: - { - WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.Events.Debug: - { - WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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 NewAzDeviceRegistryCredentials_CreateExpanded() - { - - } - - /// Performs execution of the command. - protected override void ProcessRecord() - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - __processRecordId = System.Guid.NewGuid().ToString(); - try - { - // work - if (ShouldProcess($"Call remote 'CredentialsCreateOrUpdate' operation")) - { - if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) - { - var instance = this.Clone(); - var job = new Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Token) ) - { - asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); - if (null != HttpPipelinePrepend) - { - Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); - } - if (null != HttpPipelineAppend) - { - Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); - } - // get the client instance - try - { - await ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.CredentialsCreateOrUpdate(SubscriptionId, ResourceGroupName, NamespaceName, _resourceBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeCreate); - await ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - } - catch (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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,NamespaceName=NamespaceName}) - { - ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } - }); - } - finally - { - await ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletProcessRecordAsyncEnd); - } - } - } - - /// Interrupts currently running code within the command. - protected override void StopProcessing() - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Cancel(); - base.StopProcessing(); - } - - /// - new protected void WriteObject(object sendToPipeline) - { - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); - base.WriteObject(sendToPipeline); - } - - /// - /// - new protected void WriteObject(object sendToPipeline, bool enumerateCollection) - { - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.Models.ICredential - /// 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.DeviceRegistry.Models.ICredential - var result = (await response); - WriteObject(result, false); - } - } - } -} \ No newline at end of file diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/NewAzDeviceRegistryCredentials_CreateViaJsonFilePath.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/NewAzDeviceRegistryCredentials_CreateViaJsonFilePath.cs deleted file mode 100644 index 59e71aa6387a..000000000000 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/NewAzDeviceRegistryCredentials_CreateViaJsonFilePath.cs +++ /dev/null @@ -1,575 +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.DeviceRegistry.Cmdlets -{ - using static Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Extensions; - using Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.PowerShell; - using Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Cmdlets; - using System; - - /// create a Credential - /// - /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/credentials/default" - /// - [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzDeviceRegistryCredentials_CreateViaJsonFilePath", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICredential))] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Description(@"create a Credential")] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/credentials/default", ApiVersion = "2025-11-01-preview")] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.NotSuggestDefaultParameterSet] - public partial class NewAzDeviceRegistryCredentials_CreateViaJsonFilePath : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener, - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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(); - - public global::System.String _jsonString; - - /// 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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.DeviceRegistry Client => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.ParameterCategory.Runtime)] - public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.ParameterCategory.Runtime)] - public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.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; } } - - /// - /// cancellation delegate. Stops the cmdlet when called. - /// - global::System.Action Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; - - /// cancellation token. - global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener.Token => _cancellationTokenSource.Token; - - /// Backing field for property. - private string _namespaceName; - - /// The name of the namespace. - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the namespace.")] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The name of the namespace.", - SerializedName = @"namespaceName", - PossibleTypes = new [] { typeof(string) })] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.ParameterCategory.Path)] - public string NamespaceName { get => this._namespaceName; set => this._namespaceName = value; } - - /// - /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue - /// asynchronously. - /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The name of the resource group. The name is case insensitive.", - SerializedName = @"resourceGroupName", - PossibleTypes = new [] { typeof(string) })] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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. The value must be an UUID. - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription. The value must be an UUID.")] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The ID of the target subscription. The value must be an UUID.", - SerializedName = @"subscriptionId", - PossibleTypes = new [] { typeof(string) })] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.DefaultInfo( - Name = @"", - Description =@"", - Script = @"(Get-AzContext).Subscription.Id", - SetCondition = @"")] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.Models.ICredential - /// 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.DeviceRegistry.Module.Instance.GetTelemetryId.Invoke(); - if (telemetryId != "" && telemetryId != "internal") - { - __correlationId = telemetryId; - } - Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); - if (Break) - { - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.AttachDebugger.Break(); - } - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - } - - /// Creates a duplicate instance of this cmdlet (via JSON serialization). - /// a duplicate instance of NewAzDeviceRegistryCredentials_CreateViaJsonFilePath - public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Cmdlets.NewAzDeviceRegistryCredentials_CreateViaJsonFilePath Clone() - { - var clone = new NewAzDeviceRegistryCredentials_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.NamespaceName = this.NamespaceName; - clone.JsonFilePath = this.JsonFilePath; - return clone; - } - - /// Performs clean-up after the command execution - protected override void EndProcessing() - { - var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.Runtime.Events.Verbose: - { - WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.Warning: - { - WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.Events.Debug: - { - WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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 NewAzDeviceRegistryCredentials_CreateViaJsonFilePath() - { - - } - - /// Performs execution of the command. - protected override void ProcessRecord() - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - __processRecordId = System.Guid.NewGuid().ToString(); - try - { - // work - if (ShouldProcess($"Call remote 'CredentialsCreateOrUpdate' operation")) - { - if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) - { - var instance = this.Clone(); - var job = new Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Token) ) - { - asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); - if (null != HttpPipelinePrepend) - { - Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); - } - if (null != HttpPipelineAppend) - { - Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); - } - // get the client instance - try - { - await ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.CredentialsCreateOrUpdateViaJsonString(SubscriptionId, ResourceGroupName, NamespaceName, _jsonString, onOk, onDefault, this, Pipeline); - await ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - } - catch (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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,NamespaceName=NamespaceName}) - { - ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } - }); - } - finally - { - await ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletProcessRecordAsyncEnd); - } - } - } - - /// Interrupts currently running code within the command. - protected override void StopProcessing() - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Cancel(); - base.StopProcessing(); - } - - /// - new protected void WriteObject(object sendToPipeline) - { - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); - base.WriteObject(sendToPipeline); - } - - /// - /// - new protected void WriteObject(object sendToPipeline, bool enumerateCollection) - { - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.Models.ICredential - /// 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.DeviceRegistry.Models.ICredential - var result = (await response); - WriteObject(result, false); - } - } - } -} \ No newline at end of file diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/NewAzDeviceRegistryCredentials_CreateViaJsonString.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/NewAzDeviceRegistryCredentials_CreateViaJsonString.cs deleted file mode 100644 index 16dcc8660d13..000000000000 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/NewAzDeviceRegistryCredentials_CreateViaJsonString.cs +++ /dev/null @@ -1,573 +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.DeviceRegistry.Cmdlets -{ - using static Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Extensions; - using Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.PowerShell; - using Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Cmdlets; - using System; - - /// create a Credential - /// - /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/credentials/default" - /// - [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzDeviceRegistryCredentials_CreateViaJsonString", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICredential))] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Description(@"create a Credential")] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/credentials/default", ApiVersion = "2025-11-01-preview")] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.NotSuggestDefaultParameterSet] - public partial class NewAzDeviceRegistryCredentials_CreateViaJsonString : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener, - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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(); - - /// 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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.DeviceRegistry Client => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.ParameterCategory.Runtime)] - public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.ParameterCategory.Runtime)] - public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } - - /// Accessor for our copy of the InvocationInfo. - public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } - - /// Backing field for property. - private string _jsonString; - - /// Json string supplied to the Create operation - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Json string supplied to the Create operation")] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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; } - - /// - /// cancellation delegate. Stops the cmdlet when called. - /// - global::System.Action Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; - - /// cancellation token. - global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener.Token => _cancellationTokenSource.Token; - - /// Backing field for property. - private string _namespaceName; - - /// The name of the namespace. - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the namespace.")] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The name of the namespace.", - SerializedName = @"namespaceName", - PossibleTypes = new [] { typeof(string) })] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.ParameterCategory.Path)] - public string NamespaceName { get => this._namespaceName; set => this._namespaceName = value; } - - /// - /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue - /// asynchronously. - /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The name of the resource group. The name is case insensitive.", - SerializedName = @"resourceGroupName", - PossibleTypes = new [] { typeof(string) })] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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. The value must be an UUID. - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription. The value must be an UUID.")] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The ID of the target subscription. The value must be an UUID.", - SerializedName = @"subscriptionId", - PossibleTypes = new [] { typeof(string) })] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.DefaultInfo( - Name = @"", - Description =@"", - Script = @"(Get-AzContext).Subscription.Id", - SetCondition = @"")] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.Models.ICredential - /// 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.DeviceRegistry.Module.Instance.GetTelemetryId.Invoke(); - if (telemetryId != "" && telemetryId != "internal") - { - __correlationId = telemetryId; - } - Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); - if (Break) - { - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.AttachDebugger.Break(); - } - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - } - - /// Creates a duplicate instance of this cmdlet (via JSON serialization). - /// a duplicate instance of NewAzDeviceRegistryCredentials_CreateViaJsonString - public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Cmdlets.NewAzDeviceRegistryCredentials_CreateViaJsonString Clone() - { - var clone = new NewAzDeviceRegistryCredentials_CreateViaJsonString(); - 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.NamespaceName = this.NamespaceName; - clone.JsonString = this.JsonString; - return clone; - } - - /// Performs clean-up after the command execution - protected override void EndProcessing() - { - var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.Runtime.Events.Verbose: - { - WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.Warning: - { - WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.Events.Debug: - { - WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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 NewAzDeviceRegistryCredentials_CreateViaJsonString() - { - - } - - /// Performs execution of the command. - protected override void ProcessRecord() - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - __processRecordId = System.Guid.NewGuid().ToString(); - try - { - // work - if (ShouldProcess($"Call remote 'CredentialsCreateOrUpdate' operation")) - { - if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) - { - var instance = this.Clone(); - var job = new Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Token) ) - { - asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); - if (null != HttpPipelinePrepend) - { - Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); - } - if (null != HttpPipelineAppend) - { - Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); - } - // get the client instance - try - { - await ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.CredentialsCreateOrUpdateViaJsonString(SubscriptionId, ResourceGroupName, NamespaceName, _jsonString, onOk, onDefault, this, Pipeline); - await ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - } - catch (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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,NamespaceName=NamespaceName}) - { - ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } - }); - } - finally - { - await ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletProcessRecordAsyncEnd); - } - } - } - - /// Interrupts currently running code within the command. - protected override void StopProcessing() - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Cancel(); - base.StopProcessing(); - } - - /// - new protected void WriteObject(object sendToPipeline) - { - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); - base.WriteObject(sendToPipeline); - } - - /// - /// - new protected void WriteObject(object sendToPipeline, bool enumerateCollection) - { - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.Models.ICredential - /// 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.DeviceRegistry.Models.ICredential - var result = (await response); - WriteObject(result, false); - } - } - } -} \ No newline at end of file diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/NewAzDeviceRegistryNamespaceAsset_CreateExpanded.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/NewAzDeviceRegistryNamespaceAsset_CreateExpanded.cs index a4ad438cfa99..c1ca6c74e737 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/NewAzDeviceRegistryNamespaceAsset_CreateExpanded.cs +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/NewAzDeviceRegistryNamespaceAsset_CreateExpanded.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceAsset))] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Description(@"create a NamespaceAsset")] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/assets/{assetName}", ApiVersion = "2025-11-01-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/assets/{assetName}", ApiVersion = "2025-10-01")] public partial class NewAzDeviceRegistryNamespaceAsset_CreateExpanded : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IContext diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/NewAzDeviceRegistryNamespaceAsset_CreateViaJsonFilePath.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/NewAzDeviceRegistryNamespaceAsset_CreateViaJsonFilePath.cs index bf4729e49b8e..ee1a6cf245fd 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/NewAzDeviceRegistryNamespaceAsset_CreateViaJsonFilePath.cs +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/NewAzDeviceRegistryNamespaceAsset_CreateViaJsonFilePath.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceAsset))] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Description(@"create a NamespaceAsset")] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/assets/{assetName}", ApiVersion = "2025-11-01-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/assets/{assetName}", ApiVersion = "2025-10-01")] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.NotSuggestDefaultParameterSet] public partial class NewAzDeviceRegistryNamespaceAsset_CreateViaJsonFilePath : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener, diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/NewAzDeviceRegistryNamespaceAsset_CreateViaJsonString.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/NewAzDeviceRegistryNamespaceAsset_CreateViaJsonString.cs index 851eb5264cc7..b45a6e04d163 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/NewAzDeviceRegistryNamespaceAsset_CreateViaJsonString.cs +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/NewAzDeviceRegistryNamespaceAsset_CreateViaJsonString.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceAsset))] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Description(@"create a NamespaceAsset")] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/assets/{assetName}", ApiVersion = "2025-11-01-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/assets/{assetName}", ApiVersion = "2025-10-01")] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.NotSuggestDefaultParameterSet] public partial class NewAzDeviceRegistryNamespaceAsset_CreateViaJsonString : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener, diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/NewAzDeviceRegistryNamespaceDevice_CreateExpanded.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/NewAzDeviceRegistryNamespaceDevice_CreateExpanded.cs index bad514c3f023..a541a880c1ca 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/NewAzDeviceRegistryNamespaceDevice_CreateExpanded.cs +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/NewAzDeviceRegistryNamespaceDevice_CreateExpanded.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDevice))] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Description(@"create a NamespaceDevice")] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/devices/{deviceName}", ApiVersion = "2025-11-01-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/devices/{deviceName}", ApiVersion = "2025-10-01")] public partial class NewAzDeviceRegistryNamespaceDevice_CreateExpanded : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IContext @@ -297,17 +297,6 @@ public partial class NewAzDeviceRegistryNamespaceDevice_CreateExpanded : global: /// public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.HttpPipeline Pipeline { get; set; } - /// Resource Id of the Policy. - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Resource Id of the Policy.")] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Resource Id of the Policy.", - SerializedName = @"resourceId", - PossibleTypes = new [] { typeof(string) })] - public string PolicyResourceId { get => _resourceBody.PolicyResourceId ?? null; set => _resourceBody.PolicyResourceId = 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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.ParameterCategory.Runtime)] diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/NewAzDeviceRegistryNamespaceDevice_CreateViaJsonFilePath.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/NewAzDeviceRegistryNamespaceDevice_CreateViaJsonFilePath.cs index aa5ef8ddf756..2dd3c3402157 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/NewAzDeviceRegistryNamespaceDevice_CreateViaJsonFilePath.cs +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/NewAzDeviceRegistryNamespaceDevice_CreateViaJsonFilePath.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDevice))] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Description(@"create a NamespaceDevice")] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/devices/{deviceName}", ApiVersion = "2025-11-01-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/devices/{deviceName}", ApiVersion = "2025-10-01")] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.NotSuggestDefaultParameterSet] public partial class NewAzDeviceRegistryNamespaceDevice_CreateViaJsonFilePath : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener, diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/NewAzDeviceRegistryNamespaceDevice_CreateViaJsonString.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/NewAzDeviceRegistryNamespaceDevice_CreateViaJsonString.cs index 08fcf021f2be..c026a67c223c 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/NewAzDeviceRegistryNamespaceDevice_CreateViaJsonString.cs +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/NewAzDeviceRegistryNamespaceDevice_CreateViaJsonString.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDevice))] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Description(@"create a NamespaceDevice")] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/devices/{deviceName}", ApiVersion = "2025-11-01-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/devices/{deviceName}", ApiVersion = "2025-10-01")] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.NotSuggestDefaultParameterSet] public partial class NewAzDeviceRegistryNamespaceDevice_CreateViaJsonString : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener, diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/NewAzDeviceRegistryNamespaceDiscoveredAsset_CreateExpanded.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/NewAzDeviceRegistryNamespaceDiscoveredAsset_CreateExpanded.cs index d40bbd6b1d5c..2cebd3717579 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/NewAzDeviceRegistryNamespaceDiscoveredAsset_CreateExpanded.cs +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/NewAzDeviceRegistryNamespaceDiscoveredAsset_CreateExpanded.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDiscoveredAsset))] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Description(@"create a NamespaceDiscoveredAsset")] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/discoveredAssets/{discoveredAssetName}", ApiVersion = "2025-11-01-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/discoveredAssets/{discoveredAssetName}", ApiVersion = "2025-10-01")] public partial class NewAzDeviceRegistryNamespaceDiscoveredAsset_CreateExpanded : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IContext diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/NewAzDeviceRegistryNamespaceDiscoveredAsset_CreateViaJsonFilePath.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/NewAzDeviceRegistryNamespaceDiscoveredAsset_CreateViaJsonFilePath.cs index 2365ee619233..ceb496a10b7d 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/NewAzDeviceRegistryNamespaceDiscoveredAsset_CreateViaJsonFilePath.cs +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/NewAzDeviceRegistryNamespaceDiscoveredAsset_CreateViaJsonFilePath.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDiscoveredAsset))] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Description(@"create a NamespaceDiscoveredAsset")] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/discoveredAssets/{discoveredAssetName}", ApiVersion = "2025-11-01-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/discoveredAssets/{discoveredAssetName}", ApiVersion = "2025-10-01")] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.NotSuggestDefaultParameterSet] public partial class NewAzDeviceRegistryNamespaceDiscoveredAsset_CreateViaJsonFilePath : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener, diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/NewAzDeviceRegistryNamespaceDiscoveredAsset_CreateViaJsonString.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/NewAzDeviceRegistryNamespaceDiscoveredAsset_CreateViaJsonString.cs index 6850be549206..1ce882e00884 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/NewAzDeviceRegistryNamespaceDiscoveredAsset_CreateViaJsonString.cs +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/NewAzDeviceRegistryNamespaceDiscoveredAsset_CreateViaJsonString.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDiscoveredAsset))] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Description(@"create a NamespaceDiscoveredAsset")] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/discoveredAssets/{discoveredAssetName}", ApiVersion = "2025-11-01-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/discoveredAssets/{discoveredAssetName}", ApiVersion = "2025-10-01")] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.NotSuggestDefaultParameterSet] public partial class NewAzDeviceRegistryNamespaceDiscoveredAsset_CreateViaJsonString : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener, diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/NewAzDeviceRegistryNamespaceDiscoveredDevice_CreateExpanded.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/NewAzDeviceRegistryNamespaceDiscoveredDevice_CreateExpanded.cs index fe2022e8992f..ae2de4a66f5a 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/NewAzDeviceRegistryNamespaceDiscoveredDevice_CreateExpanded.cs +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/NewAzDeviceRegistryNamespaceDiscoveredDevice_CreateExpanded.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDiscoveredDevice))] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Description(@"create a NamespaceDiscoveredDevice")] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/discoveredDevices/{discoveredDeviceName}", ApiVersion = "2025-11-01-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/discoveredDevices/{discoveredDeviceName}", ApiVersion = "2025-10-01")] public partial class NewAzDeviceRegistryNamespaceDiscoveredDevice_CreateExpanded : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IContext diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/NewAzDeviceRegistryNamespaceDiscoveredDevice_CreateViaJsonFilePath.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/NewAzDeviceRegistryNamespaceDiscoveredDevice_CreateViaJsonFilePath.cs index 24f5d10ea96b..fdc7ea512a47 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/NewAzDeviceRegistryNamespaceDiscoveredDevice_CreateViaJsonFilePath.cs +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/NewAzDeviceRegistryNamespaceDiscoveredDevice_CreateViaJsonFilePath.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDiscoveredDevice))] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Description(@"create a NamespaceDiscoveredDevice")] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/discoveredDevices/{discoveredDeviceName}", ApiVersion = "2025-11-01-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/discoveredDevices/{discoveredDeviceName}", ApiVersion = "2025-10-01")] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.NotSuggestDefaultParameterSet] public partial class NewAzDeviceRegistryNamespaceDiscoveredDevice_CreateViaJsonFilePath : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener, diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/NewAzDeviceRegistryNamespaceDiscoveredDevice_CreateViaJsonString.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/NewAzDeviceRegistryNamespaceDiscoveredDevice_CreateViaJsonString.cs index a30a28b7d1d7..119b15f4c8f9 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/NewAzDeviceRegistryNamespaceDiscoveredDevice_CreateViaJsonString.cs +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/NewAzDeviceRegistryNamespaceDiscoveredDevice_CreateViaJsonString.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDiscoveredDevice))] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Description(@"create a NamespaceDiscoveredDevice")] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/discoveredDevices/{discoveredDeviceName}", ApiVersion = "2025-11-01-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/discoveredDevices/{discoveredDeviceName}", ApiVersion = "2025-10-01")] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.NotSuggestDefaultParameterSet] public partial class NewAzDeviceRegistryNamespaceDiscoveredDevice_CreateViaJsonString : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener, diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/NewAzDeviceRegistryNamespace_CreateExpanded.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/NewAzDeviceRegistryNamespace_CreateExpanded.cs index 1cdae5de4349..2e50b7851092 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/NewAzDeviceRegistryNamespace_CreateExpanded.cs +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/NewAzDeviceRegistryNamespace_CreateExpanded.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespace))] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Description(@"create a Namespace")] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}", ApiVersion = "2025-11-01-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}", ApiVersion = "2025-10-01")] public partial class NewAzDeviceRegistryNamespace_CreateExpanded : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IContext diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/NewAzDeviceRegistryNamespace_CreateViaJsonFilePath.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/NewAzDeviceRegistryNamespace_CreateViaJsonFilePath.cs index 0b066109989d..0902b7f178dd 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/NewAzDeviceRegistryNamespace_CreateViaJsonFilePath.cs +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/NewAzDeviceRegistryNamespace_CreateViaJsonFilePath.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespace))] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Description(@"create a Namespace")] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}", ApiVersion = "2025-11-01-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}", ApiVersion = "2025-10-01")] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.NotSuggestDefaultParameterSet] public partial class NewAzDeviceRegistryNamespace_CreateViaJsonFilePath : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener, diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/NewAzDeviceRegistryNamespace_CreateViaJsonString.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/NewAzDeviceRegistryNamespace_CreateViaJsonString.cs index d161b7f7c65b..061215c08f6d 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/NewAzDeviceRegistryNamespace_CreateViaJsonString.cs +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/NewAzDeviceRegistryNamespace_CreateViaJsonString.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespace))] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Description(@"create a Namespace")] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}", ApiVersion = "2025-11-01-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}", ApiVersion = "2025-10-01")] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.NotSuggestDefaultParameterSet] public partial class NewAzDeviceRegistryNamespace_CreateViaJsonString : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener, diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/NewAzDeviceRegistryPolicy_CreateExpanded.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/NewAzDeviceRegistryPolicy_CreateExpanded.cs deleted file mode 100644 index 7ed5b3f63afa..000000000000 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/NewAzDeviceRegistryPolicy_CreateExpanded.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.DeviceRegistry.Cmdlets -{ - using static Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Extensions; - using Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.PowerShell; - using Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Cmdlets; - using System; - - /// create a Policy - /// - /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/credentials/default/policies/{policyName}" - /// - [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzDeviceRegistryPolicy_CreateExpanded", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicy))] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Description(@"create a Policy")] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/credentials/default/policies/{policyName}", ApiVersion = "2025-11-01-preview")] - public partial class NewAzDeviceRegistryPolicy_CreateExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener, - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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 Credential Policy - private Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicy _resourceBody = new Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.Policy(); - - /// 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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.DeviceRegistry Client => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.ParameterCategory.Runtime)] - public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.ParameterCategory.Runtime)] - public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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 validity period in days. - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The validity period in days.")] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The validity period in days.", - SerializedName = @"validityPeriodInDays", - PossibleTypes = new [] { typeof(int) })] - public int LeafCertificateConfigurationValidityPeriodInDay { get => _resourceBody.LeafCertificateConfigurationValidityPeriodInDay ?? default(int); set => _resourceBody.LeafCertificateConfigurationValidityPeriodInDay = 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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The geo-location where the resource lives", - SerializedName = @"location", - PossibleTypes = new [] { typeof(string) })] - public string Location { get => _resourceBody.Location ?? null; set => _resourceBody.Location = value; } - - /// - /// cancellation delegate. Stops the cmdlet when called. - /// - global::System.Action Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; - - /// cancellation token. - global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener.Token => _cancellationTokenSource.Token; - - /// Backing field for property. - private string _name; - - /// The name of the Policy tracked resource. - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the Policy tracked resource.")] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The name of the Policy tracked resource.", - SerializedName = @"policyName", - PossibleTypes = new [] { typeof(string) })] - [global::System.Management.Automation.Alias("PolicyName")] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.ParameterCategory.Path)] - public string Name { get => this._name; set => this._name = value; } - - /// Backing field for property. - private string _namespaceName; - - /// The name of the namespace. - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the namespace.")] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The name of the namespace.", - SerializedName = @"namespaceName", - PossibleTypes = new [] { typeof(string) })] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.ParameterCategory.Path)] - public string NamespaceName { get => this._namespaceName; set => this._namespaceName = value; } - - /// - /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue - /// asynchronously. - /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The name of the resource group. The name is case insensitive.", - SerializedName = @"resourceGroupName", - PossibleTypes = new [] { typeof(string) })] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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. The value must be an UUID. - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription. The value must be an UUID.")] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The ID of the target subscription. The value must be an UUID.", - SerializedName = @"subscriptionId", - PossibleTypes = new [] { typeof(string) })] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.DefaultInfo( - Name = @"", - Description =@"", - Script = @"(Get-AzContext).Subscription.Id", - SetCondition = @"")] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.ParameterCategory.Path)] - public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } - - /// Resource tags. - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.ExportAs(typeof(global::System.Collections.Hashtable))] - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Resource tags.")] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Resource tags.", - SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ITrackedResourceTags) })] - public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ITrackedResourceTags Tag { get => _resourceBody.Tag ?? null /* object */; set => _resourceBody.Tag = 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.DeviceRegistry.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.DeviceRegistry.Models.IPolicy - /// 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.DeviceRegistry.Module.Instance.GetTelemetryId.Invoke(); - if (telemetryId != "" && telemetryId != "internal") - { - __correlationId = telemetryId; - } - Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); - if (Break) - { - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.AttachDebugger.Break(); - } - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - } - - /// Creates a duplicate instance of this cmdlet (via JSON serialization). - /// a duplicate instance of NewAzDeviceRegistryPolicy_CreateExpanded - public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Cmdlets.NewAzDeviceRegistryPolicy_CreateExpanded Clone() - { - var clone = new NewAzDeviceRegistryPolicy_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._resourceBody = this._resourceBody; - clone.SubscriptionId = this.SubscriptionId; - clone.ResourceGroupName = this.ResourceGroupName; - clone.NamespaceName = this.NamespaceName; - clone.Name = this.Name; - return clone; - } - - /// Performs clean-up after the command execution - protected override void EndProcessing() - { - var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.Runtime.Events.Verbose: - { - WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.Warning: - { - WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.Events.Debug: - { - WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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 NewAzDeviceRegistryPolicy_CreateExpanded() - { - - } - - /// Performs execution of the command. - protected override void ProcessRecord() - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - __processRecordId = System.Guid.NewGuid().ToString(); - try - { - // work - if (ShouldProcess($"Call remote 'PoliciesCreateOrUpdate' operation")) - { - if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) - { - var instance = this.Clone(); - var job = new Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Token) ) - { - asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); - if (null != HttpPipelinePrepend) - { - Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); - } - if (null != HttpPipelineAppend) - { - Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); - } - // get the client instance - try - { - await ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.PoliciesCreateOrUpdate(SubscriptionId, ResourceGroupName, NamespaceName, Name, _resourceBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeCreate); - await ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - } - catch (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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,NamespaceName=NamespaceName,Name=Name}) - { - ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } - }); - } - finally - { - await ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletProcessRecordAsyncEnd); - } - } - } - - /// Interrupts currently running code within the command. - protected override void StopProcessing() - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Cancel(); - base.StopProcessing(); - } - - /// - new protected void WriteObject(object sendToPipeline) - { - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); - base.WriteObject(sendToPipeline); - } - - /// - /// - new protected void WriteObject(object sendToPipeline, bool enumerateCollection) - { - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.Models.IPolicy - /// 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.DeviceRegistry.Models.IPolicy - var result = (await response); - WriteObject(result, false); - } - } - } -} \ No newline at end of file diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/NewAzDeviceRegistryPolicy_CreateViaJsonFilePath.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/NewAzDeviceRegistryPolicy_CreateViaJsonFilePath.cs deleted file mode 100644 index 74e74c2476d2..000000000000 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/NewAzDeviceRegistryPolicy_CreateViaJsonFilePath.cs +++ /dev/null @@ -1,591 +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.DeviceRegistry.Cmdlets -{ - using static Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Extensions; - using Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.PowerShell; - using Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Cmdlets; - using System; - - /// create a Policy - /// - /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/credentials/default/policies/{policyName}" - /// - [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzDeviceRegistryPolicy_CreateViaJsonFilePath", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicy))] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Description(@"create a Policy")] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/credentials/default/policies/{policyName}", ApiVersion = "2025-11-01-preview")] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.NotSuggestDefaultParameterSet] - public partial class NewAzDeviceRegistryPolicy_CreateViaJsonFilePath : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener, - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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(); - - public global::System.String _jsonString; - - /// 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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.DeviceRegistry Client => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.ParameterCategory.Runtime)] - public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.ParameterCategory.Runtime)] - public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.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; } } - - /// - /// cancellation delegate. Stops the cmdlet when called. - /// - global::System.Action Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; - - /// cancellation token. - global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener.Token => _cancellationTokenSource.Token; - - /// Backing field for property. - private string _name; - - /// The name of the Policy tracked resource. - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the Policy tracked resource.")] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The name of the Policy tracked resource.", - SerializedName = @"policyName", - PossibleTypes = new [] { typeof(string) })] - [global::System.Management.Automation.Alias("PolicyName")] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.ParameterCategory.Path)] - public string Name { get => this._name; set => this._name = value; } - - /// Backing field for property. - private string _namespaceName; - - /// The name of the namespace. - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the namespace.")] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The name of the namespace.", - SerializedName = @"namespaceName", - PossibleTypes = new [] { typeof(string) })] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.ParameterCategory.Path)] - public string NamespaceName { get => this._namespaceName; set => this._namespaceName = value; } - - /// - /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue - /// asynchronously. - /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The name of the resource group. The name is case insensitive.", - SerializedName = @"resourceGroupName", - PossibleTypes = new [] { typeof(string) })] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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. The value must be an UUID. - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription. The value must be an UUID.")] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The ID of the target subscription. The value must be an UUID.", - SerializedName = @"subscriptionId", - PossibleTypes = new [] { typeof(string) })] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.DefaultInfo( - Name = @"", - Description =@"", - Script = @"(Get-AzContext).Subscription.Id", - SetCondition = @"")] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.Models.IPolicy - /// 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.DeviceRegistry.Module.Instance.GetTelemetryId.Invoke(); - if (telemetryId != "" && telemetryId != "internal") - { - __correlationId = telemetryId; - } - Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); - if (Break) - { - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.AttachDebugger.Break(); - } - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - } - - /// Creates a duplicate instance of this cmdlet (via JSON serialization). - /// a duplicate instance of NewAzDeviceRegistryPolicy_CreateViaJsonFilePath - public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Cmdlets.NewAzDeviceRegistryPolicy_CreateViaJsonFilePath Clone() - { - var clone = new NewAzDeviceRegistryPolicy_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.NamespaceName = this.NamespaceName; - clone.Name = this.Name; - clone.JsonFilePath = this.JsonFilePath; - return clone; - } - - /// Performs clean-up after the command execution - protected override void EndProcessing() - { - var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.Runtime.Events.Verbose: - { - WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.Warning: - { - WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.Events.Debug: - { - WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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 NewAzDeviceRegistryPolicy_CreateViaJsonFilePath() - { - - } - - /// Performs execution of the command. - protected override void ProcessRecord() - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - __processRecordId = System.Guid.NewGuid().ToString(); - try - { - // work - if (ShouldProcess($"Call remote 'PoliciesCreateOrUpdate' operation")) - { - if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) - { - var instance = this.Clone(); - var job = new Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Token) ) - { - asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); - if (null != HttpPipelinePrepend) - { - Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); - } - if (null != HttpPipelineAppend) - { - Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); - } - // get the client instance - try - { - await ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.PoliciesCreateOrUpdateViaJsonString(SubscriptionId, ResourceGroupName, NamespaceName, Name, _jsonString, onOk, onDefault, this, Pipeline); - await ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - } - catch (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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,NamespaceName=NamespaceName,Name=Name}) - { - ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } - }); - } - finally - { - await ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletProcessRecordAsyncEnd); - } - } - } - - /// Interrupts currently running code within the command. - protected override void StopProcessing() - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Cancel(); - base.StopProcessing(); - } - - /// - new protected void WriteObject(object sendToPipeline) - { - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); - base.WriteObject(sendToPipeline); - } - - /// - /// - new protected void WriteObject(object sendToPipeline, bool enumerateCollection) - { - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.Models.IPolicy - /// 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.DeviceRegistry.Models.IPolicy - var result = (await response); - WriteObject(result, false); - } - } - } -} \ No newline at end of file diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/NewAzDeviceRegistryPolicy_CreateViaJsonString.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/NewAzDeviceRegistryPolicy_CreateViaJsonString.cs deleted file mode 100644 index 1658bad56847..000000000000 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/NewAzDeviceRegistryPolicy_CreateViaJsonString.cs +++ /dev/null @@ -1,589 +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.DeviceRegistry.Cmdlets -{ - using static Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Extensions; - using Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.PowerShell; - using Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Cmdlets; - using System; - - /// create a Policy - /// - /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/credentials/default/policies/{policyName}" - /// - [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzDeviceRegistryPolicy_CreateViaJsonString", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicy))] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Description(@"create a Policy")] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/credentials/default/policies/{policyName}", ApiVersion = "2025-11-01-preview")] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.NotSuggestDefaultParameterSet] - public partial class NewAzDeviceRegistryPolicy_CreateViaJsonString : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener, - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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(); - - /// 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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.DeviceRegistry Client => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.ParameterCategory.Runtime)] - public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.ParameterCategory.Runtime)] - public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } - - /// Accessor for our copy of the InvocationInfo. - public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } - - /// Backing field for property. - private string _jsonString; - - /// Json string supplied to the Create operation - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Json string supplied to the Create operation")] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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; } - - /// - /// cancellation delegate. Stops the cmdlet when called. - /// - global::System.Action Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; - - /// cancellation token. - global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener.Token => _cancellationTokenSource.Token; - - /// Backing field for property. - private string _name; - - /// The name of the Policy tracked resource. - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the Policy tracked resource.")] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The name of the Policy tracked resource.", - SerializedName = @"policyName", - PossibleTypes = new [] { typeof(string) })] - [global::System.Management.Automation.Alias("PolicyName")] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.ParameterCategory.Path)] - public string Name { get => this._name; set => this._name = value; } - - /// Backing field for property. - private string _namespaceName; - - /// The name of the namespace. - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the namespace.")] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The name of the namespace.", - SerializedName = @"namespaceName", - PossibleTypes = new [] { typeof(string) })] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.ParameterCategory.Path)] - public string NamespaceName { get => this._namespaceName; set => this._namespaceName = value; } - - /// - /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue - /// asynchronously. - /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The name of the resource group. The name is case insensitive.", - SerializedName = @"resourceGroupName", - PossibleTypes = new [] { typeof(string) })] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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. The value must be an UUID. - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription. The value must be an UUID.")] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The ID of the target subscription. The value must be an UUID.", - SerializedName = @"subscriptionId", - PossibleTypes = new [] { typeof(string) })] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.DefaultInfo( - Name = @"", - Description =@"", - Script = @"(Get-AzContext).Subscription.Id", - SetCondition = @"")] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.Models.IPolicy - /// 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.DeviceRegistry.Module.Instance.GetTelemetryId.Invoke(); - if (telemetryId != "" && telemetryId != "internal") - { - __correlationId = telemetryId; - } - Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); - if (Break) - { - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.AttachDebugger.Break(); - } - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - } - - /// Creates a duplicate instance of this cmdlet (via JSON serialization). - /// a duplicate instance of NewAzDeviceRegistryPolicy_CreateViaJsonString - public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Cmdlets.NewAzDeviceRegistryPolicy_CreateViaJsonString Clone() - { - var clone = new NewAzDeviceRegistryPolicy_CreateViaJsonString(); - 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.NamespaceName = this.NamespaceName; - clone.Name = this.Name; - clone.JsonString = this.JsonString; - return clone; - } - - /// Performs clean-up after the command execution - protected override void EndProcessing() - { - var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.Runtime.Events.Verbose: - { - WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.Warning: - { - WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.Events.Debug: - { - WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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 NewAzDeviceRegistryPolicy_CreateViaJsonString() - { - - } - - /// Performs execution of the command. - protected override void ProcessRecord() - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - __processRecordId = System.Guid.NewGuid().ToString(); - try - { - // work - if (ShouldProcess($"Call remote 'PoliciesCreateOrUpdate' operation")) - { - if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) - { - var instance = this.Clone(); - var job = new Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Token) ) - { - asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); - if (null != HttpPipelinePrepend) - { - Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); - } - if (null != HttpPipelineAppend) - { - Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); - } - // get the client instance - try - { - await ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.PoliciesCreateOrUpdateViaJsonString(SubscriptionId, ResourceGroupName, NamespaceName, Name, _jsonString, onOk, onDefault, this, Pipeline); - await ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - } - catch (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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,NamespaceName=NamespaceName,Name=Name}) - { - ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } - }); - } - finally - { - await ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletProcessRecordAsyncEnd); - } - } - } - - /// Interrupts currently running code within the command. - protected override void StopProcessing() - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Cancel(); - base.StopProcessing(); - } - - /// - new protected void WriteObject(object sendToPipeline) - { - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); - base.WriteObject(sendToPipeline); - } - - /// - /// - new protected void WriteObject(object sendToPipeline, bool enumerateCollection) - { - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.Models.IPolicy - /// 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.DeviceRegistry.Models.IPolicy - var result = (await response); - WriteObject(result, false); - } - } - } -} \ No newline at end of file diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/NewAzDeviceRegistrySchemaRegistry_CreateExpanded.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/NewAzDeviceRegistrySchemaRegistry_CreateExpanded.cs index ac8f24b136cb..4d5176b1efb5 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/NewAzDeviceRegistrySchemaRegistry_CreateExpanded.cs +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/NewAzDeviceRegistrySchemaRegistry_CreateExpanded.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ISchemaRegistry))] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Description(@"create a SchemaRegistry")] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}", ApiVersion = "2025-11-01-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}", ApiVersion = "2025-10-01")] public partial class NewAzDeviceRegistrySchemaRegistry_CreateExpanded : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IContext diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/NewAzDeviceRegistrySchemaRegistry_CreateViaJsonFilePath.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/NewAzDeviceRegistrySchemaRegistry_CreateViaJsonFilePath.cs index 33d2682b5e8f..6255bf57d3e5 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/NewAzDeviceRegistrySchemaRegistry_CreateViaJsonFilePath.cs +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/NewAzDeviceRegistrySchemaRegistry_CreateViaJsonFilePath.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ISchemaRegistry))] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Description(@"create a SchemaRegistry")] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}", ApiVersion = "2025-11-01-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}", ApiVersion = "2025-10-01")] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.NotSuggestDefaultParameterSet] public partial class NewAzDeviceRegistrySchemaRegistry_CreateViaJsonFilePath : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener, diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/NewAzDeviceRegistrySchemaRegistry_CreateViaJsonString.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/NewAzDeviceRegistrySchemaRegistry_CreateViaJsonString.cs index c9918f2c09f7..01c1ab201272 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/NewAzDeviceRegistrySchemaRegistry_CreateViaJsonString.cs +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/NewAzDeviceRegistrySchemaRegistry_CreateViaJsonString.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ISchemaRegistry))] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Description(@"create a SchemaRegistry")] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}", ApiVersion = "2025-11-01-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}", ApiVersion = "2025-10-01")] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.NotSuggestDefaultParameterSet] public partial class NewAzDeviceRegistrySchemaRegistry_CreateViaJsonString : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener, diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/NewAzDeviceRegistrySchemaVersion_CreateExpanded.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/NewAzDeviceRegistrySchemaVersion_CreateExpanded.cs index c57672891dba..83106e9c8637 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/NewAzDeviceRegistrySchemaVersion_CreateExpanded.cs +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/NewAzDeviceRegistrySchemaVersion_CreateExpanded.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ISchemaVersion))] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Description(@"create a SchemaVersion")] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}/schemas/{schemaName}/schemaVersions/{schemaVersionName}", ApiVersion = "2025-11-01-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}/schemas/{schemaName}/schemaVersions/{schemaVersionName}", ApiVersion = "2025-10-01")] public partial class NewAzDeviceRegistrySchemaVersion_CreateExpanded : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IContext diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/NewAzDeviceRegistrySchemaVersion_CreateViaJsonFilePath.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/NewAzDeviceRegistrySchemaVersion_CreateViaJsonFilePath.cs index 9df53d1f2f42..7266396d9e25 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/NewAzDeviceRegistrySchemaVersion_CreateViaJsonFilePath.cs +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/NewAzDeviceRegistrySchemaVersion_CreateViaJsonFilePath.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ISchemaVersion))] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Description(@"create a SchemaVersion")] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}/schemas/{schemaName}/schemaVersions/{schemaVersionName}", ApiVersion = "2025-11-01-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}/schemas/{schemaName}/schemaVersions/{schemaVersionName}", ApiVersion = "2025-10-01")] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.NotSuggestDefaultParameterSet] public partial class NewAzDeviceRegistrySchemaVersion_CreateViaJsonFilePath : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener, diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/NewAzDeviceRegistrySchemaVersion_CreateViaJsonString.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/NewAzDeviceRegistrySchemaVersion_CreateViaJsonString.cs index f4278ff729bb..fa457f1c10cf 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/NewAzDeviceRegistrySchemaVersion_CreateViaJsonString.cs +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/NewAzDeviceRegistrySchemaVersion_CreateViaJsonString.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ISchemaVersion))] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Description(@"create a SchemaVersion")] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}/schemas/{schemaName}/schemaVersions/{schemaVersionName}", ApiVersion = "2025-11-01-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}/schemas/{schemaName}/schemaVersions/{schemaVersionName}", ApiVersion = "2025-10-01")] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.NotSuggestDefaultParameterSet] public partial class NewAzDeviceRegistrySchemaVersion_CreateViaJsonString : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener, diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/NewAzDeviceRegistrySchema_CreateExpanded.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/NewAzDeviceRegistrySchema_CreateExpanded.cs index 5c46e55fcfbb..3249ef9831ee 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/NewAzDeviceRegistrySchema_CreateExpanded.cs +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/NewAzDeviceRegistrySchema_CreateExpanded.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ISchema))] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Description(@"create a Schema")] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}/schemas/{schemaName}", ApiVersion = "2025-11-01-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}/schemas/{schemaName}", ApiVersion = "2025-10-01")] public partial class NewAzDeviceRegistrySchema_CreateExpanded : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IContext diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/NewAzDeviceRegistrySchema_CreateViaJsonFilePath.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/NewAzDeviceRegistrySchema_CreateViaJsonFilePath.cs index c6a1545ebab3..5a346d3d659b 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/NewAzDeviceRegistrySchema_CreateViaJsonFilePath.cs +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/NewAzDeviceRegistrySchema_CreateViaJsonFilePath.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ISchema))] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Description(@"create a Schema")] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}/schemas/{schemaName}", ApiVersion = "2025-11-01-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}/schemas/{schemaName}", ApiVersion = "2025-10-01")] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.NotSuggestDefaultParameterSet] public partial class NewAzDeviceRegistrySchema_CreateViaJsonFilePath : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener, diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/NewAzDeviceRegistrySchema_CreateViaJsonString.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/NewAzDeviceRegistrySchema_CreateViaJsonString.cs index be43197e34df..df03a4d5c85a 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/NewAzDeviceRegistrySchema_CreateViaJsonString.cs +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/NewAzDeviceRegistrySchema_CreateViaJsonString.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ISchema))] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Description(@"create a Schema")] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}/schemas/{schemaName}", ApiVersion = "2025-11-01-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}/schemas/{schemaName}", ApiVersion = "2025-10-01")] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.NotSuggestDefaultParameterSet] public partial class NewAzDeviceRegistrySchema_CreateViaJsonString : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener, diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/RemoveAzDeviceRegistryAssetEndpointProfile_Delete.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/RemoveAzDeviceRegistryAssetEndpointProfile_Delete.cs index c4e9ef259459..bba84a930bb9 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/RemoveAzDeviceRegistryAssetEndpointProfile_Delete.cs +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/RemoveAzDeviceRegistryAssetEndpointProfile_Delete.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Cmdlets [global::System.Management.Automation.OutputType(typeof(bool))] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Description(@"Delete a AssetEndpointProfile")] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/assetEndpointProfiles/{assetEndpointProfileName}", ApiVersion = "2025-11-01-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/assetEndpointProfiles/{assetEndpointProfileName}", ApiVersion = "2025-10-01")] public partial class RemoveAzDeviceRegistryAssetEndpointProfile_Delete : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IContext diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/RemoveAzDeviceRegistryAssetEndpointProfile_DeleteViaIdentity.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/RemoveAzDeviceRegistryAssetEndpointProfile_DeleteViaIdentity.cs index 665c1c6f7968..3180024a4b9d 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/RemoveAzDeviceRegistryAssetEndpointProfile_DeleteViaIdentity.cs +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/RemoveAzDeviceRegistryAssetEndpointProfile_DeleteViaIdentity.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Cmdlets [global::System.Management.Automation.OutputType(typeof(bool))] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Description(@"Delete a AssetEndpointProfile")] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/assetEndpointProfiles/{assetEndpointProfileName}", ApiVersion = "2025-11-01-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/assetEndpointProfiles/{assetEndpointProfileName}", ApiVersion = "2025-10-01")] public partial class RemoveAzDeviceRegistryAssetEndpointProfile_DeleteViaIdentity : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IContext diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/RemoveAzDeviceRegistryAsset_Delete.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/RemoveAzDeviceRegistryAsset_Delete.cs index 32201394c1bc..e647fc1bcc59 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/RemoveAzDeviceRegistryAsset_Delete.cs +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/RemoveAzDeviceRegistryAsset_Delete.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Cmdlets [global::System.Management.Automation.OutputType(typeof(bool))] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Description(@"Delete a Asset")] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/assets/{assetName}", ApiVersion = "2025-11-01-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/assets/{assetName}", ApiVersion = "2025-10-01")] public partial class RemoveAzDeviceRegistryAsset_Delete : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IContext diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/RemoveAzDeviceRegistryAsset_DeleteViaIdentity.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/RemoveAzDeviceRegistryAsset_DeleteViaIdentity.cs index 9e55ad7f01ab..4ba53b255d8e 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/RemoveAzDeviceRegistryAsset_DeleteViaIdentity.cs +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/RemoveAzDeviceRegistryAsset_DeleteViaIdentity.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Cmdlets [global::System.Management.Automation.OutputType(typeof(bool))] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Description(@"Delete a Asset")] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/assets/{assetName}", ApiVersion = "2025-11-01-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/assets/{assetName}", ApiVersion = "2025-10-01")] public partial class RemoveAzDeviceRegistryAsset_DeleteViaIdentity : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IContext diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/RemoveAzDeviceRegistryCredentials_Delete.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/RemoveAzDeviceRegistryCredentials_Delete.cs deleted file mode 100644 index 5dd64261a08e..000000000000 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/RemoveAzDeviceRegistryCredentials_Delete.cs +++ /dev/null @@ -1,596 +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.DeviceRegistry.Cmdlets -{ - using static Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Extensions; - using Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.PowerShell; - using Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Cmdlets; - using System; - - /// Delete a Credential - /// - /// [OpenAPI] Delete=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/credentials/default" - /// - [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzDeviceRegistryCredentials_Delete", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(bool))] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Description(@"Delete a Credential")] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/credentials/default", ApiVersion = "2025-11-01-preview")] - public partial class RemoveAzDeviceRegistryCredentials_Delete : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener, - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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(); - - /// 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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.DeviceRegistry Client => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.ParameterCategory.Runtime)] - public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.ParameterCategory.Runtime)] - public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } - - /// Accessor for our copy of the InvocationInfo. - public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } - - /// - /// cancellation delegate. Stops the cmdlet when called. - /// - global::System.Action Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; - - /// cancellation token. - global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener.Token => _cancellationTokenSource.Token; - - /// Backing field for property. - private string _namespaceName; - - /// The name of the namespace. - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the namespace.")] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The name of the namespace.", - SerializedName = @"namespaceName", - PossibleTypes = new [] { typeof(string) })] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.ParameterCategory.Path)] - public string NamespaceName { get => this._namespaceName; set => this._namespaceName = value; } - - /// - /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue - /// asynchronously. - /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The name of the resource group. The name is case insensitive.", - SerializedName = @"resourceGroupName", - PossibleTypes = new [] { typeof(string) })] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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. The value must be an UUID. - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription. The value must be an UUID.")] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The ID of the target subscription. The value must be an UUID.", - SerializedName = @"subscriptionId", - PossibleTypes = new [] { typeof(string) })] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.DefaultInfo( - Name = @"", - Description =@"", - Script = @"(Get-AzContext).Subscription.Id", - SetCondition = @"")] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.Module.Instance.GetTelemetryId.Invoke(); - if (telemetryId != "" && telemetryId != "internal") - { - __correlationId = telemetryId; - } - Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); - if (Break) - { - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.AttachDebugger.Break(); - } - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - } - - /// Creates a duplicate instance of this cmdlet (via JSON serialization). - /// a duplicate instance of RemoveAzDeviceRegistryCredentials_Delete - public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Cmdlets.RemoveAzDeviceRegistryCredentials_Delete Clone() - { - var clone = new RemoveAzDeviceRegistryCredentials_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.NamespaceName = this.NamespaceName; - return clone; - } - - /// Performs clean-up after the command execution - protected override void EndProcessing() - { - var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.Runtime.Events.Verbose: - { - WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.Warning: - { - WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.Events.Debug: - { - WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - __processRecordId = System.Guid.NewGuid().ToString(); - try - { - // work - if (ShouldProcess($"Call remote 'CredentialsDelete' operation")) - { - if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) - { - var instance = this.Clone(); - var job = new Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Token) ) - { - asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); - if (null != HttpPipelinePrepend) - { - Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); - } - if (null != HttpPipelineAppend) - { - Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); - } - // get the client instance - try - { - await ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.CredentialsDelete(SubscriptionId, ResourceGroupName, NamespaceName, onNoContent, onOk, onDefault, this, Pipeline); - await ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - } - catch (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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,NamespaceName=NamespaceName}) - { - ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } - }); - } - finally - { - await ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletProcessRecordAsyncEnd); - } - } - } - - /// - /// Initializes a new instance of the cmdlet class. - /// - public RemoveAzDeviceRegistryCredentials_Delete() - { - - } - - /// Interrupts currently running code within the command. - protected override void StopProcessing() - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Cancel(); - base.StopProcessing(); - } - - /// - new protected void WriteObject(object sendToPipeline) - { - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); - base.WriteObject(sendToPipeline); - } - - /// - /// - new protected void WriteObject(object sendToPipeline, bool enumerateCollection) - { - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.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 == InvocationInformation?.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 == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) - { - WriteObject(true); - } - } - } - } -} \ No newline at end of file diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/RemoveAzDeviceRegistryCredentials_DeleteViaIdentity.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/RemoveAzDeviceRegistryCredentials_DeleteViaIdentity.cs deleted file mode 100644 index 2d41eae730da..000000000000 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/RemoveAzDeviceRegistryCredentials_DeleteViaIdentity.cs +++ /dev/null @@ -1,574 +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.DeviceRegistry.Cmdlets -{ - using static Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Extensions; - using Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.PowerShell; - using Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Cmdlets; - using System; - - /// Delete a Credential - /// - /// [OpenAPI] Delete=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/credentials/default" - /// - [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzDeviceRegistryCredentials_DeleteViaIdentity", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(bool))] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Description(@"Delete a Credential")] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/credentials/default", ApiVersion = "2025-11-01-preview")] - public partial class RemoveAzDeviceRegistryCredentials_DeleteViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener, - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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(); - - /// 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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.DeviceRegistry Client => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.ParameterCategory.Runtime)] - public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.ParameterCategory.Runtime)] - public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IDeviceRegistryIdentity _inputObject; - - /// Identity Parameter - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.ParameterCategory.Path)] - public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IDeviceRegistryIdentity 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.DeviceRegistry.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; - - /// cancellation token. - global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.Module.Instance.GetTelemetryId.Invoke(); - if (telemetryId != "" && telemetryId != "internal") - { - __correlationId = telemetryId; - } - Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); - if (Break) - { - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.AttachDebugger.Break(); - } - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - } - - /// Creates a duplicate instance of this cmdlet (via JSON serialization). - /// a duplicate instance of RemoveAzDeviceRegistryCredentials_DeleteViaIdentity - public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Cmdlets.RemoveAzDeviceRegistryCredentials_DeleteViaIdentity Clone() - { - var clone = new RemoveAzDeviceRegistryCredentials_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() - { - var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.Runtime.Events.Verbose: - { - WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.Warning: - { - WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.Events.Debug: - { - WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - __processRecordId = System.Guid.NewGuid().ToString(); - try - { - // work - if (ShouldProcess($"Call remote 'CredentialsDelete' operation")) - { - if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) - { - var instance = this.Clone(); - var job = new Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Token) ) - { - asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); - if (null != HttpPipelinePrepend) - { - Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); - } - if (null != HttpPipelineAppend) - { - Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); - } - // get the client instance - try - { - await ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - if (InputObject?.Id != null) - { - await this.Client.CredentialsDeleteViaIdentity(InputObject.Id, onNoContent, onOk, onDefault, this, Pipeline); - } - else - { - // try to call with PATH parameters from Input Object - if (null == InputObject.SubscriptionId) - { - ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); - } - if (null == InputObject.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.NamespaceName) - { - ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.NamespaceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); - } - await this.Client.CredentialsDelete(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.NamespaceName ?? null, onNoContent, onOk, onDefault, this, Pipeline); - } - await ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - } - catch (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletProcessRecordAsyncEnd); - } - } - } - - /// - /// Initializes a new instance of the cmdlet class. - /// - public RemoveAzDeviceRegistryCredentials_DeleteViaIdentity() - { - - } - - /// Interrupts currently running code within the command. - protected override void StopProcessing() - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Cancel(); - base.StopProcessing(); - } - - /// - new protected void WriteObject(object sendToPipeline) - { - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); - base.WriteObject(sendToPipeline); - } - - /// - /// - new protected void WriteObject(object sendToPipeline, bool enumerateCollection) - { - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.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 == InvocationInformation?.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 == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) - { - WriteObject(true); - } - } - } - } -} \ No newline at end of file diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/RemoveAzDeviceRegistryNamespaceAsset_Delete.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/RemoveAzDeviceRegistryNamespaceAsset_Delete.cs index 3bf4b6e32ba9..e2a55959b4f6 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/RemoveAzDeviceRegistryNamespaceAsset_Delete.cs +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/RemoveAzDeviceRegistryNamespaceAsset_Delete.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Cmdlets [global::System.Management.Automation.OutputType(typeof(bool))] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Description(@"Delete a NamespaceAsset")] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/assets/{assetName}", ApiVersion = "2025-11-01-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/assets/{assetName}", ApiVersion = "2025-10-01")] public partial class RemoveAzDeviceRegistryNamespaceAsset_Delete : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IContext diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/RemoveAzDeviceRegistryNamespaceAsset_DeleteViaIdentity.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/RemoveAzDeviceRegistryNamespaceAsset_DeleteViaIdentity.cs index 8a60055bc6d8..6026b2700668 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/RemoveAzDeviceRegistryNamespaceAsset_DeleteViaIdentity.cs +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/RemoveAzDeviceRegistryNamespaceAsset_DeleteViaIdentity.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Cmdlets [global::System.Management.Automation.OutputType(typeof(bool))] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Description(@"Delete a NamespaceAsset")] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/assets/{assetName}", ApiVersion = "2025-11-01-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/assets/{assetName}", ApiVersion = "2025-10-01")] public partial class RemoveAzDeviceRegistryNamespaceAsset_DeleteViaIdentity : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IContext diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/RemoveAzDeviceRegistryNamespaceAsset_DeleteViaIdentityNamespace.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/RemoveAzDeviceRegistryNamespaceAsset_DeleteViaIdentityNamespace.cs index c99c38feba32..862dc84d125e 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/RemoveAzDeviceRegistryNamespaceAsset_DeleteViaIdentityNamespace.cs +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/RemoveAzDeviceRegistryNamespaceAsset_DeleteViaIdentityNamespace.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Cmdlets [global::System.Management.Automation.OutputType(typeof(bool))] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Description(@"Delete a NamespaceAsset")] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/assets/{assetName}", ApiVersion = "2025-11-01-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/assets/{assetName}", ApiVersion = "2025-10-01")] public partial class RemoveAzDeviceRegistryNamespaceAsset_DeleteViaIdentityNamespace : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IContext diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/RemoveAzDeviceRegistryNamespaceDevice_Delete.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/RemoveAzDeviceRegistryNamespaceDevice_Delete.cs index 79183a6f1673..a61e571330e6 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/RemoveAzDeviceRegistryNamespaceDevice_Delete.cs +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/RemoveAzDeviceRegistryNamespaceDevice_Delete.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Cmdlets [global::System.Management.Automation.OutputType(typeof(bool))] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Description(@"Delete a NamespaceDevice")] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/devices/{deviceName}", ApiVersion = "2025-11-01-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/devices/{deviceName}", ApiVersion = "2025-10-01")] public partial class RemoveAzDeviceRegistryNamespaceDevice_Delete : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IContext diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/RemoveAzDeviceRegistryNamespaceDevice_DeleteViaIdentity.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/RemoveAzDeviceRegistryNamespaceDevice_DeleteViaIdentity.cs index 8bdb6ed4f1a6..67f0650efbf8 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/RemoveAzDeviceRegistryNamespaceDevice_DeleteViaIdentity.cs +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/RemoveAzDeviceRegistryNamespaceDevice_DeleteViaIdentity.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Cmdlets [global::System.Management.Automation.OutputType(typeof(bool))] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Description(@"Delete a NamespaceDevice")] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/devices/{deviceName}", ApiVersion = "2025-11-01-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/devices/{deviceName}", ApiVersion = "2025-10-01")] public partial class RemoveAzDeviceRegistryNamespaceDevice_DeleteViaIdentity : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IContext diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/RemoveAzDeviceRegistryNamespaceDevice_DeleteViaIdentityNamespace.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/RemoveAzDeviceRegistryNamespaceDevice_DeleteViaIdentityNamespace.cs index 9abc81d2da50..bf9576d08f3d 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/RemoveAzDeviceRegistryNamespaceDevice_DeleteViaIdentityNamespace.cs +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/RemoveAzDeviceRegistryNamespaceDevice_DeleteViaIdentityNamespace.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Cmdlets [global::System.Management.Automation.OutputType(typeof(bool))] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Description(@"Delete a NamespaceDevice")] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/devices/{deviceName}", ApiVersion = "2025-11-01-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/devices/{deviceName}", ApiVersion = "2025-10-01")] public partial class RemoveAzDeviceRegistryNamespaceDevice_DeleteViaIdentityNamespace : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IContext diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/RemoveAzDeviceRegistryNamespaceDiscoveredAsset_Delete.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/RemoveAzDeviceRegistryNamespaceDiscoveredAsset_Delete.cs index eb2e3c7d8326..db293c5380ee 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/RemoveAzDeviceRegistryNamespaceDiscoveredAsset_Delete.cs +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/RemoveAzDeviceRegistryNamespaceDiscoveredAsset_Delete.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Cmdlets [global::System.Management.Automation.OutputType(typeof(bool))] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Description(@"Delete a NamespaceDiscoveredAsset")] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/discoveredAssets/{discoveredAssetName}", ApiVersion = "2025-11-01-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/discoveredAssets/{discoveredAssetName}", ApiVersion = "2025-10-01")] public partial class RemoveAzDeviceRegistryNamespaceDiscoveredAsset_Delete : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IContext diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/RemoveAzDeviceRegistryNamespaceDiscoveredAsset_DeleteViaIdentity.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/RemoveAzDeviceRegistryNamespaceDiscoveredAsset_DeleteViaIdentity.cs index 051b84c79cb3..e28239e4ec68 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/RemoveAzDeviceRegistryNamespaceDiscoveredAsset_DeleteViaIdentity.cs +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/RemoveAzDeviceRegistryNamespaceDiscoveredAsset_DeleteViaIdentity.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Cmdlets [global::System.Management.Automation.OutputType(typeof(bool))] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Description(@"Delete a NamespaceDiscoveredAsset")] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/discoveredAssets/{discoveredAssetName}", ApiVersion = "2025-11-01-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/discoveredAssets/{discoveredAssetName}", ApiVersion = "2025-10-01")] public partial class RemoveAzDeviceRegistryNamespaceDiscoveredAsset_DeleteViaIdentity : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IContext diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/RemoveAzDeviceRegistryNamespaceDiscoveredAsset_DeleteViaIdentityNamespace.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/RemoveAzDeviceRegistryNamespaceDiscoveredAsset_DeleteViaIdentityNamespace.cs index d5b0576abd09..fd6fd0f745f6 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/RemoveAzDeviceRegistryNamespaceDiscoveredAsset_DeleteViaIdentityNamespace.cs +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/RemoveAzDeviceRegistryNamespaceDiscoveredAsset_DeleteViaIdentityNamespace.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Cmdlets [global::System.Management.Automation.OutputType(typeof(bool))] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Description(@"Delete a NamespaceDiscoveredAsset")] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/discoveredAssets/{discoveredAssetName}", ApiVersion = "2025-11-01-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/discoveredAssets/{discoveredAssetName}", ApiVersion = "2025-10-01")] public partial class RemoveAzDeviceRegistryNamespaceDiscoveredAsset_DeleteViaIdentityNamespace : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IContext diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/RemoveAzDeviceRegistryNamespaceDiscoveredDevice_Delete.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/RemoveAzDeviceRegistryNamespaceDiscoveredDevice_Delete.cs index 62a0c993f7fe..e50ea655a93a 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/RemoveAzDeviceRegistryNamespaceDiscoveredDevice_Delete.cs +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/RemoveAzDeviceRegistryNamespaceDiscoveredDevice_Delete.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Cmdlets [global::System.Management.Automation.OutputType(typeof(bool))] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Description(@"Delete a NamespaceDiscoveredDevice")] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/discoveredDevices/{discoveredDeviceName}", ApiVersion = "2025-11-01-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/discoveredDevices/{discoveredDeviceName}", ApiVersion = "2025-10-01")] public partial class RemoveAzDeviceRegistryNamespaceDiscoveredDevice_Delete : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IContext diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/RemoveAzDeviceRegistryNamespaceDiscoveredDevice_DeleteViaIdentity.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/RemoveAzDeviceRegistryNamespaceDiscoveredDevice_DeleteViaIdentity.cs index 34177cb7958d..d2f541158dac 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/RemoveAzDeviceRegistryNamespaceDiscoveredDevice_DeleteViaIdentity.cs +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/RemoveAzDeviceRegistryNamespaceDiscoveredDevice_DeleteViaIdentity.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Cmdlets [global::System.Management.Automation.OutputType(typeof(bool))] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Description(@"Delete a NamespaceDiscoveredDevice")] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/discoveredDevices/{discoveredDeviceName}", ApiVersion = "2025-11-01-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/discoveredDevices/{discoveredDeviceName}", ApiVersion = "2025-10-01")] public partial class RemoveAzDeviceRegistryNamespaceDiscoveredDevice_DeleteViaIdentity : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IContext diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/RemoveAzDeviceRegistryNamespaceDiscoveredDevice_DeleteViaIdentityNamespace.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/RemoveAzDeviceRegistryNamespaceDiscoveredDevice_DeleteViaIdentityNamespace.cs index 6e4a3e4527e3..c4df2abb7e30 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/RemoveAzDeviceRegistryNamespaceDiscoveredDevice_DeleteViaIdentityNamespace.cs +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/RemoveAzDeviceRegistryNamespaceDiscoveredDevice_DeleteViaIdentityNamespace.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Cmdlets [global::System.Management.Automation.OutputType(typeof(bool))] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Description(@"Delete a NamespaceDiscoveredDevice")] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/discoveredDevices/{discoveredDeviceName}", ApiVersion = "2025-11-01-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/discoveredDevices/{discoveredDeviceName}", ApiVersion = "2025-10-01")] public partial class RemoveAzDeviceRegistryNamespaceDiscoveredDevice_DeleteViaIdentityNamespace : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IContext diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/RemoveAzDeviceRegistryNamespace_Delete.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/RemoveAzDeviceRegistryNamespace_Delete.cs index fa0c7083ca63..2746ccfbacce 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/RemoveAzDeviceRegistryNamespace_Delete.cs +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/RemoveAzDeviceRegistryNamespace_Delete.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Cmdlets [global::System.Management.Automation.OutputType(typeof(bool))] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Description(@"Delete a Namespace")] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}", ApiVersion = "2025-11-01-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}", ApiVersion = "2025-10-01")] public partial class RemoveAzDeviceRegistryNamespace_Delete : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IContext diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/RemoveAzDeviceRegistryNamespace_DeleteViaIdentity.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/RemoveAzDeviceRegistryNamespace_DeleteViaIdentity.cs index e04d3fa3e101..0ba744274309 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/RemoveAzDeviceRegistryNamespace_DeleteViaIdentity.cs +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/RemoveAzDeviceRegistryNamespace_DeleteViaIdentity.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Cmdlets [global::System.Management.Automation.OutputType(typeof(bool))] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Description(@"Delete a Namespace")] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}", ApiVersion = "2025-11-01-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}", ApiVersion = "2025-10-01")] public partial class RemoveAzDeviceRegistryNamespace_DeleteViaIdentity : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IContext diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/RemoveAzDeviceRegistryPolicy_Delete.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/RemoveAzDeviceRegistryPolicy_Delete.cs deleted file mode 100644 index 328e89326447..000000000000 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/RemoveAzDeviceRegistryPolicy_Delete.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.DeviceRegistry.Cmdlets -{ - using static Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Extensions; - using Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.PowerShell; - using Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Cmdlets; - using System; - - /// Delete a Policy - /// - /// [OpenAPI] Delete=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/credentials/default/policies/{policyName}" - /// - [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzDeviceRegistryPolicy_Delete", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(bool))] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Description(@"Delete a Policy")] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/credentials/default/policies/{policyName}", ApiVersion = "2025-11-01-preview")] - public partial class RemoveAzDeviceRegistryPolicy_Delete : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener, - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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(); - - /// 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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.DeviceRegistry Client => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.ParameterCategory.Runtime)] - public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.ParameterCategory.Runtime)] - public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } - - /// Accessor for our copy of the InvocationInfo. - public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } - - /// - /// cancellation delegate. Stops the cmdlet when called. - /// - global::System.Action Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; - - /// cancellation token. - global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener.Token => _cancellationTokenSource.Token; - - /// Backing field for property. - private string _name; - - /// The name of the Policy tracked resource. - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the Policy tracked resource.")] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The name of the Policy tracked resource.", - SerializedName = @"policyName", - PossibleTypes = new [] { typeof(string) })] - [global::System.Management.Automation.Alias("PolicyName")] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.ParameterCategory.Path)] - public string Name { get => this._name; set => this._name = value; } - - /// Backing field for property. - private string _namespaceName; - - /// The name of the namespace. - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the namespace.")] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The name of the namespace.", - SerializedName = @"namespaceName", - PossibleTypes = new [] { typeof(string) })] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.ParameterCategory.Path)] - public string NamespaceName { get => this._namespaceName; set => this._namespaceName = value; } - - /// - /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue - /// asynchronously. - /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The name of the resource group. The name is case insensitive.", - SerializedName = @"resourceGroupName", - PossibleTypes = new [] { typeof(string) })] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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. The value must be an UUID. - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription. The value must be an UUID.")] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The ID of the target subscription. The value must be an UUID.", - SerializedName = @"subscriptionId", - PossibleTypes = new [] { typeof(string) })] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.DefaultInfo( - Name = @"", - Description =@"", - Script = @"(Get-AzContext).Subscription.Id", - SetCondition = @"")] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.Module.Instance.GetTelemetryId.Invoke(); - if (telemetryId != "" && telemetryId != "internal") - { - __correlationId = telemetryId; - } - Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); - if (Break) - { - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.AttachDebugger.Break(); - } - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - } - - /// Creates a duplicate instance of this cmdlet (via JSON serialization). - /// a duplicate instance of RemoveAzDeviceRegistryPolicy_Delete - public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Cmdlets.RemoveAzDeviceRegistryPolicy_Delete Clone() - { - var clone = new RemoveAzDeviceRegistryPolicy_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.NamespaceName = this.NamespaceName; - clone.Name = this.Name; - return clone; - } - - /// Performs clean-up after the command execution - protected override void EndProcessing() - { - var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.Runtime.Events.Verbose: - { - WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.Warning: - { - WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.Events.Debug: - { - WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - __processRecordId = System.Guid.NewGuid().ToString(); - try - { - // work - if (ShouldProcess($"Call remote 'PoliciesDelete' operation")) - { - if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) - { - var instance = this.Clone(); - var job = new Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Token) ) - { - asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); - if (null != HttpPipelinePrepend) - { - Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); - } - if (null != HttpPipelineAppend) - { - Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); - } - // get the client instance - try - { - await ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.PoliciesDelete(SubscriptionId, ResourceGroupName, NamespaceName, Name, onNoContent, onOk, onDefault, this, Pipeline); - await ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - } - catch (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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,NamespaceName=NamespaceName,Name=Name}) - { - ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } - }); - } - finally - { - await ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletProcessRecordAsyncEnd); - } - } - } - - /// - /// Initializes a new instance of the cmdlet class. - /// - public RemoveAzDeviceRegistryPolicy_Delete() - { - - } - - /// Interrupts currently running code within the command. - protected override void StopProcessing() - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Cancel(); - base.StopProcessing(); - } - - /// - new protected void WriteObject(object sendToPipeline) - { - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); - base.WriteObject(sendToPipeline); - } - - /// - /// - new protected void WriteObject(object sendToPipeline, bool enumerateCollection) - { - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.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 == InvocationInformation?.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 == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) - { - WriteObject(true); - } - } - } - } -} \ No newline at end of file diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/RemoveAzDeviceRegistryPolicy_DeleteViaIdentity.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/RemoveAzDeviceRegistryPolicy_DeleteViaIdentity.cs deleted file mode 100644 index 1b7f5adc0013..000000000000 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/RemoveAzDeviceRegistryPolicy_DeleteViaIdentity.cs +++ /dev/null @@ -1,578 +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.DeviceRegistry.Cmdlets -{ - using static Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Extensions; - using Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.PowerShell; - using Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Cmdlets; - using System; - - /// Delete a Policy - /// - /// [OpenAPI] Delete=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/credentials/default/policies/{policyName}" - /// - [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzDeviceRegistryPolicy_DeleteViaIdentity", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(bool))] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Description(@"Delete a Policy")] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/credentials/default/policies/{policyName}", ApiVersion = "2025-11-01-preview")] - public partial class RemoveAzDeviceRegistryPolicy_DeleteViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener, - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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(); - - /// 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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.DeviceRegistry Client => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.ParameterCategory.Runtime)] - public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.ParameterCategory.Runtime)] - public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IDeviceRegistryIdentity _inputObject; - - /// Identity Parameter - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.ParameterCategory.Path)] - public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IDeviceRegistryIdentity 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.DeviceRegistry.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; - - /// cancellation token. - global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.Module.Instance.GetTelemetryId.Invoke(); - if (telemetryId != "" && telemetryId != "internal") - { - __correlationId = telemetryId; - } - Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); - if (Break) - { - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.AttachDebugger.Break(); - } - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - } - - /// Creates a duplicate instance of this cmdlet (via JSON serialization). - /// a duplicate instance of RemoveAzDeviceRegistryPolicy_DeleteViaIdentity - public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Cmdlets.RemoveAzDeviceRegistryPolicy_DeleteViaIdentity Clone() - { - var clone = new RemoveAzDeviceRegistryPolicy_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() - { - var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.Runtime.Events.Verbose: - { - WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.Warning: - { - WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.Events.Debug: - { - WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - __processRecordId = System.Guid.NewGuid().ToString(); - try - { - // work - if (ShouldProcess($"Call remote 'PoliciesDelete' operation")) - { - if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) - { - var instance = this.Clone(); - var job = new Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Token) ) - { - asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); - if (null != HttpPipelinePrepend) - { - Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); - } - if (null != HttpPipelineAppend) - { - Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); - } - // get the client instance - try - { - await ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - if (InputObject?.Id != null) - { - await this.Client.PoliciesDeleteViaIdentity(InputObject.Id, onNoContent, onOk, onDefault, this, Pipeline); - } - else - { - // try to call with PATH parameters from Input Object - if (null == InputObject.SubscriptionId) - { - ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); - } - if (null == InputObject.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.NamespaceName) - { - ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.NamespaceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); - } - if (null == InputObject.PolicyName) - { - ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.PolicyName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); - } - await this.Client.PoliciesDelete(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.NamespaceName ?? null, InputObject.PolicyName ?? null, onNoContent, onOk, onDefault, this, Pipeline); - } - await ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - } - catch (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletProcessRecordAsyncEnd); - } - } - } - - /// - /// Initializes a new instance of the cmdlet class. - /// - public RemoveAzDeviceRegistryPolicy_DeleteViaIdentity() - { - - } - - /// Interrupts currently running code within the command. - protected override void StopProcessing() - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Cancel(); - base.StopProcessing(); - } - - /// - new protected void WriteObject(object sendToPipeline) - { - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); - base.WriteObject(sendToPipeline); - } - - /// - /// - new protected void WriteObject(object sendToPipeline, bool enumerateCollection) - { - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.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 == InvocationInformation?.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 == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) - { - WriteObject(true); - } - } - } - } -} \ No newline at end of file diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/RemoveAzDeviceRegistryPolicy_DeleteViaIdentityNamespace.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/RemoveAzDeviceRegistryPolicy_DeleteViaIdentityNamespace.cs deleted file mode 100644 index e4607eb8e400..000000000000 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/RemoveAzDeviceRegistryPolicy_DeleteViaIdentityNamespace.cs +++ /dev/null @@ -1,591 +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.DeviceRegistry.Cmdlets -{ - using static Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Extensions; - using Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.PowerShell; - using Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Cmdlets; - using System; - - /// Delete a Policy - /// - /// [OpenAPI] Delete=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/credentials/default/policies/{policyName}" - /// - [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzDeviceRegistryPolicy_DeleteViaIdentityNamespace", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(bool))] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Description(@"Delete a Policy")] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/credentials/default/policies/{policyName}", ApiVersion = "2025-11-01-preview")] - public partial class RemoveAzDeviceRegistryPolicy_DeleteViaIdentityNamespace : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener, - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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(); - - /// 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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.DeviceRegistry Client => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.ParameterCategory.Runtime)] - public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.ParameterCategory.Runtime)] - public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } - - /// Accessor for our copy of the InvocationInfo. - public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } - - /// - /// cancellation delegate. Stops the cmdlet when called. - /// - global::System.Action Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; - - /// cancellation token. - global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener.Token => _cancellationTokenSource.Token; - - /// Backing field for property. - private string _name; - - /// The name of the Policy tracked resource. - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the Policy tracked resource.")] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The name of the Policy tracked resource.", - SerializedName = @"policyName", - PossibleTypes = new [] { typeof(string) })] - [global::System.Management.Automation.Alias("PolicyName")] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.ParameterCategory.Path)] - public string Name { get => this._name; set => this._name = value; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IDeviceRegistryIdentity _namespaceInputObject; - - /// Identity Parameter - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.ParameterCategory.Path)] - public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IDeviceRegistryIdentity NamespaceInputObject { get => this._namespaceInputObject; set => this._namespaceInputObject = value; } - - /// - /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue - /// asynchronously. - /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.Module.Instance.GetTelemetryId.Invoke(); - if (telemetryId != "" && telemetryId != "internal") - { - __correlationId = telemetryId; - } - Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); - if (Break) - { - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.AttachDebugger.Break(); - } - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - } - - /// Creates a duplicate instance of this cmdlet (via JSON serialization). - /// a duplicate instance of RemoveAzDeviceRegistryPolicy_DeleteViaIdentityNamespace - public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Cmdlets.RemoveAzDeviceRegistryPolicy_DeleteViaIdentityNamespace Clone() - { - var clone = new RemoveAzDeviceRegistryPolicy_DeleteViaIdentityNamespace(); - 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.Name = this.Name; - return clone; - } - - /// Performs clean-up after the command execution - protected override void EndProcessing() - { - var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.Runtime.Events.Verbose: - { - WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.Warning: - { - WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.Events.Debug: - { - WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - __processRecordId = System.Guid.NewGuid().ToString(); - try - { - // work - if (ShouldProcess($"Call remote 'PoliciesDelete' operation")) - { - if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) - { - var instance = this.Clone(); - var job = new Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Token) ) - { - asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); - if (null != HttpPipelinePrepend) - { - Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); - } - if (null != HttpPipelineAppend) - { - Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); - } - // get the client instance - try - { - await ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - if (NamespaceInputObject?.Id != null) - { - this.NamespaceInputObject.Id += $"/policies/{(global::System.Uri.EscapeDataString(this.Name.ToString()))}"; - await this.Client.PoliciesDeleteViaIdentity(NamespaceInputObject.Id, onNoContent, onOk, onDefault, this, Pipeline); - } - else - { - // try to call with PATH parameters from Input Object - if (null == NamespaceInputObject.SubscriptionId) - { - ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("NamespaceInputObject has null value for NamespaceInputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, NamespaceInputObject) ); - } - if (null == NamespaceInputObject.ResourceGroupName) - { - ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("NamespaceInputObject has null value for NamespaceInputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, NamespaceInputObject) ); - } - if (null == NamespaceInputObject.NamespaceName) - { - ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("NamespaceInputObject has null value for NamespaceInputObject.NamespaceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, NamespaceInputObject) ); - } - await this.Client.PoliciesDelete(NamespaceInputObject.SubscriptionId ?? null, NamespaceInputObject.ResourceGroupName ?? null, NamespaceInputObject.NamespaceName ?? null, Name, onNoContent, onOk, onDefault, this, Pipeline); - } - await ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - } - catch (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.UndeclaredResponseException urexception) - { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Name=Name}) - { - ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } - }); - } - finally - { - await ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletProcessRecordAsyncEnd); - } - } - } - - /// - /// Initializes a new instance of the cmdlet class. - /// - public RemoveAzDeviceRegistryPolicy_DeleteViaIdentityNamespace() - { - - } - - /// Interrupts currently running code within the command. - protected override void StopProcessing() - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Cancel(); - base.StopProcessing(); - } - - /// - new protected void WriteObject(object sendToPipeline) - { - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); - base.WriteObject(sendToPipeline); - } - - /// - /// - new protected void WriteObject(object sendToPipeline, bool enumerateCollection) - { - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.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 == InvocationInformation?.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 == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) - { - WriteObject(true); - } - } - } - } -} \ No newline at end of file diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/RemoveAzDeviceRegistrySchemaRegistry_Delete.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/RemoveAzDeviceRegistrySchemaRegistry_Delete.cs index ef3518ce5e98..e63f70f9c359 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/RemoveAzDeviceRegistrySchemaRegistry_Delete.cs +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/RemoveAzDeviceRegistrySchemaRegistry_Delete.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Cmdlets [global::System.Management.Automation.OutputType(typeof(bool))] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Description(@"Delete a SchemaRegistry")] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}", ApiVersion = "2025-11-01-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}", ApiVersion = "2025-10-01")] public partial class RemoveAzDeviceRegistrySchemaRegistry_Delete : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IContext diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/RemoveAzDeviceRegistrySchemaRegistry_DeleteViaIdentity.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/RemoveAzDeviceRegistrySchemaRegistry_DeleteViaIdentity.cs index 3b518b40c14e..0aa2cd313381 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/RemoveAzDeviceRegistrySchemaRegistry_DeleteViaIdentity.cs +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/RemoveAzDeviceRegistrySchemaRegistry_DeleteViaIdentity.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Cmdlets [global::System.Management.Automation.OutputType(typeof(bool))] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Description(@"Delete a SchemaRegistry")] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}", ApiVersion = "2025-11-01-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}", ApiVersion = "2025-10-01")] public partial class RemoveAzDeviceRegistrySchemaRegistry_DeleteViaIdentity : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IContext diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/RemoveAzDeviceRegistrySchemaVersion_Delete.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/RemoveAzDeviceRegistrySchemaVersion_Delete.cs index 24e34414de1e..5add1d8f69e2 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/RemoveAzDeviceRegistrySchemaVersion_Delete.cs +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/RemoveAzDeviceRegistrySchemaVersion_Delete.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Cmdlets [global::System.Management.Automation.OutputType(typeof(bool))] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Description(@"Delete a SchemaVersion")] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}/schemas/{schemaName}/schemaVersions/{schemaVersionName}", ApiVersion = "2025-11-01-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}/schemas/{schemaName}/schemaVersions/{schemaVersionName}", ApiVersion = "2025-10-01")] public partial class RemoveAzDeviceRegistrySchemaVersion_Delete : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IContext diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/RemoveAzDeviceRegistrySchemaVersion_DeleteViaIdentity.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/RemoveAzDeviceRegistrySchemaVersion_DeleteViaIdentity.cs index 8c9f6477c61a..3bcdeb034788 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/RemoveAzDeviceRegistrySchemaVersion_DeleteViaIdentity.cs +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/RemoveAzDeviceRegistrySchemaVersion_DeleteViaIdentity.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Cmdlets [global::System.Management.Automation.OutputType(typeof(bool))] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Description(@"Delete a SchemaVersion")] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}/schemas/{schemaName}/schemaVersions/{schemaVersionName}", ApiVersion = "2025-11-01-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}/schemas/{schemaName}/schemaVersions/{schemaVersionName}", ApiVersion = "2025-10-01")] public partial class RemoveAzDeviceRegistrySchemaVersion_DeleteViaIdentity : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IContext diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/RemoveAzDeviceRegistrySchemaVersion_DeleteViaIdentitySchema.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/RemoveAzDeviceRegistrySchemaVersion_DeleteViaIdentitySchema.cs index ea37bd816b7f..e030d79cf316 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/RemoveAzDeviceRegistrySchemaVersion_DeleteViaIdentitySchema.cs +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/RemoveAzDeviceRegistrySchemaVersion_DeleteViaIdentitySchema.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Cmdlets [global::System.Management.Automation.OutputType(typeof(bool))] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Description(@"Delete a SchemaVersion")] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}/schemas/{schemaName}/schemaVersions/{schemaVersionName}", ApiVersion = "2025-11-01-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}/schemas/{schemaName}/schemaVersions/{schemaVersionName}", ApiVersion = "2025-10-01")] public partial class RemoveAzDeviceRegistrySchemaVersion_DeleteViaIdentitySchema : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IContext diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/RemoveAzDeviceRegistrySchemaVersion_DeleteViaIdentitySchemaRegistry.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/RemoveAzDeviceRegistrySchemaVersion_DeleteViaIdentitySchemaRegistry.cs index ca6093d3a128..e265d0f1b305 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/RemoveAzDeviceRegistrySchemaVersion_DeleteViaIdentitySchemaRegistry.cs +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/RemoveAzDeviceRegistrySchemaVersion_DeleteViaIdentitySchemaRegistry.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Cmdlets [global::System.Management.Automation.OutputType(typeof(bool))] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Description(@"Delete a SchemaVersion")] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}/schemas/{schemaName}/schemaVersions/{schemaVersionName}", ApiVersion = "2025-11-01-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}/schemas/{schemaName}/schemaVersions/{schemaVersionName}", ApiVersion = "2025-10-01")] public partial class RemoveAzDeviceRegistrySchemaVersion_DeleteViaIdentitySchemaRegistry : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IContext diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/RemoveAzDeviceRegistrySchema_Delete.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/RemoveAzDeviceRegistrySchema_Delete.cs index 4fa40dff5a2d..78cf9b79561d 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/RemoveAzDeviceRegistrySchema_Delete.cs +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/RemoveAzDeviceRegistrySchema_Delete.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Cmdlets [global::System.Management.Automation.OutputType(typeof(bool))] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Description(@"Delete a Schema")] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}/schemas/{schemaName}", ApiVersion = "2025-11-01-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}/schemas/{schemaName}", ApiVersion = "2025-10-01")] public partial class RemoveAzDeviceRegistrySchema_Delete : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IContext diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/RemoveAzDeviceRegistrySchema_DeleteViaIdentity.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/RemoveAzDeviceRegistrySchema_DeleteViaIdentity.cs index b93366163a62..294b6543884a 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/RemoveAzDeviceRegistrySchema_DeleteViaIdentity.cs +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/RemoveAzDeviceRegistrySchema_DeleteViaIdentity.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Cmdlets [global::System.Management.Automation.OutputType(typeof(bool))] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Description(@"Delete a Schema")] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}/schemas/{schemaName}", ApiVersion = "2025-11-01-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}/schemas/{schemaName}", ApiVersion = "2025-10-01")] public partial class RemoveAzDeviceRegistrySchema_DeleteViaIdentity : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IContext diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/RemoveAzDeviceRegistrySchema_DeleteViaIdentitySchemaRegistry.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/RemoveAzDeviceRegistrySchema_DeleteViaIdentitySchemaRegistry.cs index bacdc8edb6c9..cce3ab464da5 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/RemoveAzDeviceRegistrySchema_DeleteViaIdentitySchemaRegistry.cs +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/RemoveAzDeviceRegistrySchema_DeleteViaIdentitySchemaRegistry.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Cmdlets [global::System.Management.Automation.OutputType(typeof(bool))] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Description(@"Delete a Schema")] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}/schemas/{schemaName}", ApiVersion = "2025-11-01-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}/schemas/{schemaName}", ApiVersion = "2025-10-01")] public partial class RemoveAzDeviceRegistrySchema_DeleteViaIdentitySchemaRegistry : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IContext diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/SyncAzDeviceRegistryCredentials_Synchronize.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/SyncAzDeviceRegistryCredentials_Synchronize.cs deleted file mode 100644 index 40009813bd64..000000000000 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/SyncAzDeviceRegistryCredentials_Synchronize.cs +++ /dev/null @@ -1,562 +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.DeviceRegistry.Cmdlets -{ - using static Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Extensions; - using Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.PowerShell; - using Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Cmdlets; - using System; - - /// A long-running resource action. - /// - /// [OpenAPI] Synchronize=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/credentials/default/synchronize" - /// - [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Sync, @"AzDeviceRegistryCredentials_Synchronize", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(bool))] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Description(@"A long-running resource action.")] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/credentials/default/synchronize", ApiVersion = "2025-11-01-preview")] - public partial class SyncAzDeviceRegistryCredentials_Synchronize : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener, - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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(); - - /// 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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.DeviceRegistry Client => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.ParameterCategory.Runtime)] - public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.ParameterCategory.Runtime)] - public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } - - /// Accessor for our copy of the InvocationInfo. - public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } - - /// - /// cancellation delegate. Stops the cmdlet when called. - /// - global::System.Action Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; - - /// cancellation token. - global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener.Token => _cancellationTokenSource.Token; - - /// Backing field for property. - private string _namespaceName; - - /// The name of the namespace. - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the namespace.")] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The name of the namespace.", - SerializedName = @"namespaceName", - PossibleTypes = new [] { typeof(string) })] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.ParameterCategory.Path)] - public string NamespaceName { get => this._namespaceName; set => this._namespaceName = value; } - - /// - /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue - /// asynchronously. - /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The name of the resource group. The name is case insensitive.", - SerializedName = @"resourceGroupName", - PossibleTypes = new [] { typeof(string) })] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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. The value must be an UUID. - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription. The value must be an UUID.")] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The ID of the target subscription. The value must be an UUID.", - SerializedName = @"subscriptionId", - PossibleTypes = new [] { typeof(string) })] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.DefaultInfo( - Name = @"", - Description =@"", - Script = @"(Get-AzContext).Subscription.Id", - SetCondition = @"")] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.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. - /// /// 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.DeviceRegistry.Module.Instance.GetTelemetryId.Invoke(); - if (telemetryId != "" && telemetryId != "internal") - { - __correlationId = telemetryId; - } - Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); - if (Break) - { - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.AttachDebugger.Break(); - } - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - } - - /// Creates a duplicate instance of this cmdlet (via JSON serialization). - /// a duplicate instance of SyncAzDeviceRegistryCredentials_Synchronize - public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Cmdlets.SyncAzDeviceRegistryCredentials_Synchronize Clone() - { - var clone = new SyncAzDeviceRegistryCredentials_Synchronize(); - 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.NamespaceName = this.NamespaceName; - return clone; - } - - /// Performs clean-up after the command execution - protected override void EndProcessing() - { - var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.Runtime.Events.Verbose: - { - WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.Warning: - { - WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.Events.Debug: - { - WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - __processRecordId = System.Guid.NewGuid().ToString(); - try - { - // work - if (ShouldProcess($"Call remote 'CredentialsSynchronize' operation")) - { - if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) - { - var instance = this.Clone(); - var job = new Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Token) ) - { - asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); - if (null != HttpPipelinePrepend) - { - Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); - } - if (null != HttpPipelineAppend) - { - Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); - } - // get the client instance - try - { - await ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.CredentialsSynchronize(SubscriptionId, ResourceGroupName, NamespaceName, onOk, onDefault, this, Pipeline); - await ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - } - catch (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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,NamespaceName=NamespaceName}) - { - ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } - }); - } - finally - { - await ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletProcessRecordAsyncEnd); - } - } - } - - /// Interrupts currently running code within the command. - protected override void StopProcessing() - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Cancel(); - base.StopProcessing(); - } - - /// - /// Initializes a new instance of the cmdlet class. - /// - public SyncAzDeviceRegistryCredentials_Synchronize() - { - - } - - /// - new protected void WriteObject(object sendToPipeline) - { - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); - base.WriteObject(sendToPipeline); - } - - /// - /// - new protected void WriteObject(object sendToPipeline, bool enumerateCollection) - { - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) - { - ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } - }); - } - else - { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) - { - ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } - }); - } - } - } - - /// a delegate that is called when the remote service returns 200 (OK). - /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// - /// A that will be complete when handling of the method is completed. - /// - private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage) - { - using( NoSynchronizationContext ) - { - var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); - overrideOnOk(responseMessage, ref _returnNow); - // if overrideOnOk has returned true, then return right away. - if ((null != _returnNow && await _returnNow)) - { - return ; - } - // onOk - response for 200 / - if (true == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) - { - WriteObject(true); - } - } - } - } -} \ No newline at end of file diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/SyncAzDeviceRegistryCredentials_SynchronizeViaIdentity.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/SyncAzDeviceRegistryCredentials_SynchronizeViaIdentity.cs deleted file mode 100644 index 9cc19b1dbb40..000000000000 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/SyncAzDeviceRegistryCredentials_SynchronizeViaIdentity.cs +++ /dev/null @@ -1,540 +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.DeviceRegistry.Cmdlets -{ - using static Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Extensions; - using Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.PowerShell; - using Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Cmdlets; - using System; - - /// A long-running resource action. - /// - /// [OpenAPI] Synchronize=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/credentials/default/synchronize" - /// - [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Sync, @"AzDeviceRegistryCredentials_SynchronizeViaIdentity", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(bool))] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Description(@"A long-running resource action.")] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/credentials/default/synchronize", ApiVersion = "2025-11-01-preview")] - public partial class SyncAzDeviceRegistryCredentials_SynchronizeViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener, - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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(); - - /// 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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.DeviceRegistry Client => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.ParameterCategory.Runtime)] - public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.ParameterCategory.Runtime)] - public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IDeviceRegistryIdentity _inputObject; - - /// Identity Parameter - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.ParameterCategory.Path)] - public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IDeviceRegistryIdentity 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.DeviceRegistry.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; - - /// cancellation token. - global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.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. - /// /// 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.DeviceRegistry.Module.Instance.GetTelemetryId.Invoke(); - if (telemetryId != "" && telemetryId != "internal") - { - __correlationId = telemetryId; - } - Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); - if (Break) - { - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.AttachDebugger.Break(); - } - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - } - - /// Creates a duplicate instance of this cmdlet (via JSON serialization). - /// a duplicate instance of SyncAzDeviceRegistryCredentials_SynchronizeViaIdentity - public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Cmdlets.SyncAzDeviceRegistryCredentials_SynchronizeViaIdentity Clone() - { - var clone = new SyncAzDeviceRegistryCredentials_SynchronizeViaIdentity(); - 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() - { - var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.Runtime.Events.Verbose: - { - WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.Warning: - { - WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.Events.Debug: - { - WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - __processRecordId = System.Guid.NewGuid().ToString(); - try - { - // work - if (ShouldProcess($"Call remote 'CredentialsSynchronize' operation")) - { - if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) - { - var instance = this.Clone(); - var job = new Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Token) ) - { - asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); - if (null != HttpPipelinePrepend) - { - Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); - } - if (null != HttpPipelineAppend) - { - Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); - } - // get the client instance - try - { - await ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - if (InputObject?.Id != null) - { - await this.Client.CredentialsSynchronizeViaIdentity(InputObject.Id, onOk, onDefault, this, Pipeline); - } - else - { - // try to call with PATH parameters from Input Object - if (null == InputObject.SubscriptionId) - { - ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); - } - if (null == InputObject.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.NamespaceName) - { - ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.NamespaceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); - } - await this.Client.CredentialsSynchronize(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.NamespaceName ?? null, onOk, onDefault, this, Pipeline); - } - await ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - } - catch (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletProcessRecordAsyncEnd); - } - } - } - - /// Interrupts currently running code within the command. - protected override void StopProcessing() - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Cancel(); - base.StopProcessing(); - } - - /// - /// Initializes a new instance of the cmdlet class. - /// - public SyncAzDeviceRegistryCredentials_SynchronizeViaIdentity() - { - - } - - /// - new protected void WriteObject(object sendToPipeline) - { - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); - base.WriteObject(sendToPipeline); - } - - /// - /// - new protected void WriteObject(object sendToPipeline, bool enumerateCollection) - { - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) - { - ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } - }); - } - else - { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) - { - ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } - }); - } - } - } - - /// a delegate that is called when the remote service returns 200 (OK). - /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// - /// A that will be complete when handling of the method is completed. - /// - private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage) - { - using( NoSynchronizationContext ) - { - var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); - overrideOnOk(responseMessage, ref _returnNow); - // if overrideOnOk has returned true, then return right away. - if ((null != _returnNow && await _returnNow)) - { - return ; - } - // onOk - response for 200 / - if (true == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) - { - WriteObject(true); - } - } - } - } -} \ No newline at end of file diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/UpdateAzDeviceRegistryAssetEndpointProfile_UpdateExpanded.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/UpdateAzDeviceRegistryAssetEndpointProfile_UpdateExpanded.cs index 39e0dc235449..9250aca6763e 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/UpdateAzDeviceRegistryAssetEndpointProfile_UpdateExpanded.cs +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/UpdateAzDeviceRegistryAssetEndpointProfile_UpdateExpanded.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetEndpointProfile))] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Description(@"update a AssetEndpointProfile")] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/assetEndpointProfiles/{assetEndpointProfileName}", ApiVersion = "2025-11-01-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/assetEndpointProfiles/{assetEndpointProfileName}", ApiVersion = "2025-10-01")] public partial class UpdateAzDeviceRegistryAssetEndpointProfile_UpdateExpanded : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IContext diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/UpdateAzDeviceRegistryAssetEndpointProfile_UpdateViaIdentityExpanded.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/UpdateAzDeviceRegistryAssetEndpointProfile_UpdateViaIdentityExpanded.cs index 3f2af8f3f28a..997e4287983d 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/UpdateAzDeviceRegistryAssetEndpointProfile_UpdateViaIdentityExpanded.cs +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/UpdateAzDeviceRegistryAssetEndpointProfile_UpdateViaIdentityExpanded.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetEndpointProfile))] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Description(@"update a AssetEndpointProfile")] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/assetEndpointProfiles/{assetEndpointProfileName}", ApiVersion = "2025-11-01-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/assetEndpointProfiles/{assetEndpointProfileName}", ApiVersion = "2025-10-01")] public partial class UpdateAzDeviceRegistryAssetEndpointProfile_UpdateViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IContext diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/UpdateAzDeviceRegistryAssetEndpointProfile_UpdateViaJsonFilePath.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/UpdateAzDeviceRegistryAssetEndpointProfile_UpdateViaJsonFilePath.cs index 4f45c16331a1..48c3b28c2fe7 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/UpdateAzDeviceRegistryAssetEndpointProfile_UpdateViaJsonFilePath.cs +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/UpdateAzDeviceRegistryAssetEndpointProfile_UpdateViaJsonFilePath.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetEndpointProfile))] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Description(@"update a AssetEndpointProfile")] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/assetEndpointProfiles/{assetEndpointProfileName}", ApiVersion = "2025-11-01-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/assetEndpointProfiles/{assetEndpointProfileName}", ApiVersion = "2025-10-01")] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.NotSuggestDefaultParameterSet] public partial class UpdateAzDeviceRegistryAssetEndpointProfile_UpdateViaJsonFilePath : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener, diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/UpdateAzDeviceRegistryAssetEndpointProfile_UpdateViaJsonString.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/UpdateAzDeviceRegistryAssetEndpointProfile_UpdateViaJsonString.cs index 215dbf6270d8..347cefecc609 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/UpdateAzDeviceRegistryAssetEndpointProfile_UpdateViaJsonString.cs +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/UpdateAzDeviceRegistryAssetEndpointProfile_UpdateViaJsonString.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetEndpointProfile))] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Description(@"update a AssetEndpointProfile")] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/assetEndpointProfiles/{assetEndpointProfileName}", ApiVersion = "2025-11-01-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/assetEndpointProfiles/{assetEndpointProfileName}", ApiVersion = "2025-10-01")] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.NotSuggestDefaultParameterSet] public partial class UpdateAzDeviceRegistryAssetEndpointProfile_UpdateViaJsonString : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener, diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/UpdateAzDeviceRegistryAsset_UpdateExpanded.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/UpdateAzDeviceRegistryAsset_UpdateExpanded.cs index e8e378b982ff..1cf12a82dd47 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/UpdateAzDeviceRegistryAsset_UpdateExpanded.cs +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/UpdateAzDeviceRegistryAsset_UpdateExpanded.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAsset))] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Description(@"update a Asset")] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/assets/{assetName}", ApiVersion = "2025-11-01-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/assets/{assetName}", ApiVersion = "2025-10-01")] public partial class UpdateAzDeviceRegistryAsset_UpdateExpanded : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IContext diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/UpdateAzDeviceRegistryAsset_UpdateViaIdentityExpanded.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/UpdateAzDeviceRegistryAsset_UpdateViaIdentityExpanded.cs index 42a62d7d1082..ea7639e5eb6e 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/UpdateAzDeviceRegistryAsset_UpdateViaIdentityExpanded.cs +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/UpdateAzDeviceRegistryAsset_UpdateViaIdentityExpanded.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAsset))] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Description(@"update a Asset")] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/assets/{assetName}", ApiVersion = "2025-11-01-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/assets/{assetName}", ApiVersion = "2025-10-01")] public partial class UpdateAzDeviceRegistryAsset_UpdateViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IContext diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/UpdateAzDeviceRegistryAsset_UpdateViaJsonFilePath.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/UpdateAzDeviceRegistryAsset_UpdateViaJsonFilePath.cs index 65b40bc66e51..5e2e792f9c2a 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/UpdateAzDeviceRegistryAsset_UpdateViaJsonFilePath.cs +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/UpdateAzDeviceRegistryAsset_UpdateViaJsonFilePath.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAsset))] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Description(@"update a Asset")] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/assets/{assetName}", ApiVersion = "2025-11-01-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/assets/{assetName}", ApiVersion = "2025-10-01")] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.NotSuggestDefaultParameterSet] public partial class UpdateAzDeviceRegistryAsset_UpdateViaJsonFilePath : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener, diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/UpdateAzDeviceRegistryAsset_UpdateViaJsonString.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/UpdateAzDeviceRegistryAsset_UpdateViaJsonString.cs index c750bae4a6a7..8916f01af5ba 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/UpdateAzDeviceRegistryAsset_UpdateViaJsonString.cs +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/UpdateAzDeviceRegistryAsset_UpdateViaJsonString.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAsset))] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Description(@"update a Asset")] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/assets/{assetName}", ApiVersion = "2025-11-01-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/assets/{assetName}", ApiVersion = "2025-10-01")] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.NotSuggestDefaultParameterSet] public partial class UpdateAzDeviceRegistryAsset_UpdateViaJsonString : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener, diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/UpdateAzDeviceRegistryCredentials_UpdateExpanded.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/UpdateAzDeviceRegistryCredentials_UpdateExpanded.cs deleted file mode 100644 index f64f0459da1b..000000000000 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/UpdateAzDeviceRegistryCredentials_UpdateExpanded.cs +++ /dev/null @@ -1,574 +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.DeviceRegistry.Cmdlets -{ - using static Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Extensions; - using Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.PowerShell; - using Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Cmdlets; - using System; - - /// update a Credential - /// - /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/credentials/default" - /// - [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzDeviceRegistryCredentials_UpdateExpanded", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICredential))] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Description(@"update a Credential")] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/credentials/default", ApiVersion = "2025-11-01-preview")] - public partial class UpdateAzDeviceRegistryCredentials_UpdateExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener, - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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(); - - /// The type used for update operations of the Credential. - private Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICredentialUpdate _propertiesBody = new Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.CredentialUpdate(); - - /// 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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.DeviceRegistry Client => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.ParameterCategory.Runtime)] - public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.ParameterCategory.Runtime)] - public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } - - /// Accessor for our copy of the InvocationInfo. - public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } - - /// - /// cancellation delegate. Stops the cmdlet when called. - /// - global::System.Action Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; - - /// cancellation token. - global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener.Token => _cancellationTokenSource.Token; - - /// Backing field for property. - private string _namespaceName; - - /// The name of the namespace. - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the namespace.")] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The name of the namespace.", - SerializedName = @"namespaceName", - PossibleTypes = new [] { typeof(string) })] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.ParameterCategory.Path)] - public string NamespaceName { get => this._namespaceName; set => this._namespaceName = value; } - - /// - /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue - /// asynchronously. - /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The name of the resource group. The name is case insensitive.", - SerializedName = @"resourceGroupName", - PossibleTypes = new [] { typeof(string) })] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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. The value must be an UUID. - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription. The value must be an UUID.")] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The ID of the target subscription. The value must be an UUID.", - SerializedName = @"subscriptionId", - PossibleTypes = new [] { typeof(string) })] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.DefaultInfo( - Name = @"", - Description =@"", - Script = @"(Get-AzContext).Subscription.Id", - SetCondition = @"")] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.ParameterCategory.Path)] - public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } - - /// Resource tags. - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.ExportAs(typeof(global::System.Collections.Hashtable))] - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Resource tags.")] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Resource tags.", - SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICredentialUpdateTags) })] - public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICredentialUpdateTags Tag { get => _propertiesBody.Tag ?? null /* object */; set => _propertiesBody.Tag = 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.DeviceRegistry.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.DeviceRegistry.Models.ICredential - /// 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.DeviceRegistry.Module.Instance.GetTelemetryId.Invoke(); - if (telemetryId != "" && telemetryId != "internal") - { - __correlationId = telemetryId; - } - Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); - if (Break) - { - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.AttachDebugger.Break(); - } - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - } - - /// Creates a duplicate instance of this cmdlet (via JSON serialization). - /// a duplicate instance of UpdateAzDeviceRegistryCredentials_UpdateExpanded - public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Cmdlets.UpdateAzDeviceRegistryCredentials_UpdateExpanded Clone() - { - var clone = new UpdateAzDeviceRegistryCredentials_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._propertiesBody = this._propertiesBody; - clone.SubscriptionId = this.SubscriptionId; - clone.ResourceGroupName = this.ResourceGroupName; - clone.NamespaceName = this.NamespaceName; - return clone; - } - - /// Performs clean-up after the command execution - protected override void EndProcessing() - { - var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.Runtime.Events.Verbose: - { - WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.Warning: - { - WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.Events.Debug: - { - WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - __processRecordId = System.Guid.NewGuid().ToString(); - try - { - // work - if (ShouldProcess($"Call remote 'CredentialsUpdate' operation")) - { - if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) - { - var instance = this.Clone(); - var job = new Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Token) ) - { - asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); - if (null != HttpPipelinePrepend) - { - Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); - } - if (null != HttpPipelineAppend) - { - Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); - } - // get the client instance - try - { - await ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.CredentialsUpdate(SubscriptionId, ResourceGroupName, NamespaceName, _propertiesBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeUpdate); - await ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - } - catch (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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,NamespaceName=NamespaceName}) - { - ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } - }); - } - finally - { - await ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletProcessRecordAsyncEnd); - } - } - } - - /// Interrupts currently running code within the command. - protected override void StopProcessing() - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Cancel(); - base.StopProcessing(); - } - - /// - /// Initializes a new instance of the cmdlet class. - /// - public UpdateAzDeviceRegistryCredentials_UpdateExpanded() - { - - } - - /// - new protected void WriteObject(object sendToPipeline) - { - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); - base.WriteObject(sendToPipeline); - } - - /// - /// - new protected void WriteObject(object sendToPipeline, bool enumerateCollection) - { - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.Models.ICredential - /// 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.DeviceRegistry.Models.ICredential - var result = (await response); - WriteObject(result, false); - } - } - } -} \ No newline at end of file diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/UpdateAzDeviceRegistryCredentials_UpdateViaIdentityExpanded.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/UpdateAzDeviceRegistryCredentials_UpdateViaIdentityExpanded.cs deleted file mode 100644 index 9c8eb083a8a4..000000000000 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/UpdateAzDeviceRegistryCredentials_UpdateViaIdentityExpanded.cs +++ /dev/null @@ -1,554 +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.DeviceRegistry.Cmdlets -{ - using static Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Extensions; - using Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.PowerShell; - using Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Cmdlets; - using System; - - /// update a Credential - /// - /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/credentials/default" - /// - [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzDeviceRegistryCredentials_UpdateViaIdentityExpanded", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICredential))] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Description(@"update a Credential")] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/credentials/default", ApiVersion = "2025-11-01-preview")] - public partial class UpdateAzDeviceRegistryCredentials_UpdateViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener, - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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(); - - /// The type used for update operations of the Credential. - private Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICredentialUpdate _propertiesBody = new Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.CredentialUpdate(); - - /// 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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.DeviceRegistry Client => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.ParameterCategory.Runtime)] - public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.ParameterCategory.Runtime)] - public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IDeviceRegistryIdentity _inputObject; - - /// Identity Parameter - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.ParameterCategory.Path)] - public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IDeviceRegistryIdentity 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.DeviceRegistry.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; - - /// cancellation token. - global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.ParameterCategory.Runtime)] - public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } - - /// Resource tags. - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.ExportAs(typeof(global::System.Collections.Hashtable))] - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Resource tags.")] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Resource tags.", - SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICredentialUpdateTags) })] - public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICredentialUpdateTags Tag { get => _propertiesBody.Tag ?? null /* object */; set => _propertiesBody.Tag = 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.DeviceRegistry.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.DeviceRegistry.Models.ICredential - /// 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.DeviceRegistry.Module.Instance.GetTelemetryId.Invoke(); - if (telemetryId != "" && telemetryId != "internal") - { - __correlationId = telemetryId; - } - Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); - if (Break) - { - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.AttachDebugger.Break(); - } - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - } - - /// Creates a duplicate instance of this cmdlet (via JSON serialization). - /// - /// a duplicate instance of UpdateAzDeviceRegistryCredentials_UpdateViaIdentityExpanded - /// - public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Cmdlets.UpdateAzDeviceRegistryCredentials_UpdateViaIdentityExpanded Clone() - { - var clone = new UpdateAzDeviceRegistryCredentials_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._propertiesBody = this._propertiesBody; - return clone; - } - - /// Performs clean-up after the command execution - protected override void EndProcessing() - { - var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.Runtime.Events.Verbose: - { - WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.Warning: - { - WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.Events.Debug: - { - WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - __processRecordId = System.Guid.NewGuid().ToString(); - try - { - // work - if (ShouldProcess($"Call remote 'CredentialsUpdate' operation")) - { - if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) - { - var instance = this.Clone(); - var job = new Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Token) ) - { - asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); - if (null != HttpPipelinePrepend) - { - Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); - } - if (null != HttpPipelineAppend) - { - Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); - } - // get the client instance - try - { - await ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - if (InputObject?.Id != null) - { - await this.Client.CredentialsUpdateViaIdentity(InputObject.Id, _propertiesBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.NamespaceName) - { - ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.NamespaceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); - } - await this.Client.CredentialsUpdate(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.NamespaceName ?? null, _propertiesBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeUpdate); - } - await ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - } - catch (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletProcessRecordAsyncEnd); - } - } - } - - /// Interrupts currently running code within the command. - protected override void StopProcessing() - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Cancel(); - base.StopProcessing(); - } - - /// - /// Initializes a new instance of the cmdlet class. - /// - public UpdateAzDeviceRegistryCredentials_UpdateViaIdentityExpanded() - { - - } - - /// - new protected void WriteObject(object sendToPipeline) - { - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); - base.WriteObject(sendToPipeline); - } - - /// - /// - new protected void WriteObject(object sendToPipeline, bool enumerateCollection) - { - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.Models.ICredential - /// 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.DeviceRegistry.Models.ICredential - var result = (await response); - WriteObject(result, false); - } - } - } -} \ No newline at end of file diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/UpdateAzDeviceRegistryCredentials_UpdateViaJsonFilePath.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/UpdateAzDeviceRegistryCredentials_UpdateViaJsonFilePath.cs deleted file mode 100644 index 9b500155aba2..000000000000 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/UpdateAzDeviceRegistryCredentials_UpdateViaJsonFilePath.cs +++ /dev/null @@ -1,575 +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.DeviceRegistry.Cmdlets -{ - using static Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Extensions; - using Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.PowerShell; - using Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Cmdlets; - using System; - - /// update a Credential - /// - /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/credentials/default" - /// - [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzDeviceRegistryCredentials_UpdateViaJsonFilePath", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICredential))] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Description(@"update a Credential")] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/credentials/default", ApiVersion = "2025-11-01-preview")] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.NotSuggestDefaultParameterSet] - public partial class UpdateAzDeviceRegistryCredentials_UpdateViaJsonFilePath : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener, - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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(); - - public global::System.String _jsonString; - - /// 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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.DeviceRegistry Client => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.ParameterCategory.Runtime)] - public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.ParameterCategory.Runtime)] - public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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 Update operation - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Path of Json file supplied to the Update operation")] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"Path of Json file supplied to the Update operation", - SerializedName = @"JsonFilePath", - PossibleTypes = new [] { typeof(string) })] - public string JsonFilePath { get => this._jsonFilePath; set { if (!System.IO.File.Exists(value)) { throw new Exception("Cannot find File " + value); } this._jsonString = System.IO.File.ReadAllText(value); this._jsonFilePath = value; } } - - /// - /// cancellation delegate. Stops the cmdlet when called. - /// - global::System.Action Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; - - /// cancellation token. - global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener.Token => _cancellationTokenSource.Token; - - /// Backing field for property. - private string _namespaceName; - - /// The name of the namespace. - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the namespace.")] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The name of the namespace.", - SerializedName = @"namespaceName", - PossibleTypes = new [] { typeof(string) })] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.ParameterCategory.Path)] - public string NamespaceName { get => this._namespaceName; set => this._namespaceName = value; } - - /// - /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue - /// asynchronously. - /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The name of the resource group. The name is case insensitive.", - SerializedName = @"resourceGroupName", - PossibleTypes = new [] { typeof(string) })] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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. The value must be an UUID. - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription. The value must be an UUID.")] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The ID of the target subscription. The value must be an UUID.", - SerializedName = @"subscriptionId", - PossibleTypes = new [] { typeof(string) })] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.DefaultInfo( - Name = @"", - Description =@"", - Script = @"(Get-AzContext).Subscription.Id", - SetCondition = @"")] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.Models.ICredential - /// 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.DeviceRegistry.Module.Instance.GetTelemetryId.Invoke(); - if (telemetryId != "" && telemetryId != "internal") - { - __correlationId = telemetryId; - } - Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); - if (Break) - { - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.AttachDebugger.Break(); - } - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - } - - /// Creates a duplicate instance of this cmdlet (via JSON serialization). - /// a duplicate instance of UpdateAzDeviceRegistryCredentials_UpdateViaJsonFilePath - public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Cmdlets.UpdateAzDeviceRegistryCredentials_UpdateViaJsonFilePath Clone() - { - var clone = new UpdateAzDeviceRegistryCredentials_UpdateViaJsonFilePath(); - clone.__correlationId = this.__correlationId; - clone.__processRecordId = this.__processRecordId; - clone.DefaultProfile = this.DefaultProfile; - clone.InvocationInformation = this.InvocationInformation; - clone.Proxy = this.Proxy; - clone.Pipeline = this.Pipeline; - clone.AsJob = this.AsJob; - clone.Break = this.Break; - clone.ProxyCredential = this.ProxyCredential; - clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; - clone.HttpPipelinePrepend = this.HttpPipelinePrepend; - clone.HttpPipelineAppend = this.HttpPipelineAppend; - clone.SubscriptionId = this.SubscriptionId; - clone.ResourceGroupName = this.ResourceGroupName; - clone.NamespaceName = this.NamespaceName; - clone.JsonFilePath = this.JsonFilePath; - return clone; - } - - /// Performs clean-up after the command execution - protected override void EndProcessing() - { - var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.Runtime.Events.Verbose: - { - WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.Warning: - { - WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.Events.Debug: - { - WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - __processRecordId = System.Guid.NewGuid().ToString(); - try - { - // work - if (ShouldProcess($"Call remote 'CredentialsUpdate' operation")) - { - if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) - { - var instance = this.Clone(); - var job = new Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Token) ) - { - asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); - if (null != HttpPipelinePrepend) - { - Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); - } - if (null != HttpPipelineAppend) - { - Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); - } - // get the client instance - try - { - await ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.CredentialsUpdateViaJsonString(SubscriptionId, ResourceGroupName, NamespaceName, _jsonString, onOk, onDefault, this, Pipeline); - await ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - } - catch (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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,NamespaceName=NamespaceName}) - { - ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } - }); - } - finally - { - await ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletProcessRecordAsyncEnd); - } - } - } - - /// Interrupts currently running code within the command. - protected override void StopProcessing() - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Cancel(); - base.StopProcessing(); - } - - /// - /// Initializes a new instance of the cmdlet class. - /// - public UpdateAzDeviceRegistryCredentials_UpdateViaJsonFilePath() - { - - } - - /// - new protected void WriteObject(object sendToPipeline) - { - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); - base.WriteObject(sendToPipeline); - } - - /// - /// - new protected void WriteObject(object sendToPipeline, bool enumerateCollection) - { - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.Models.ICredential - /// 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.DeviceRegistry.Models.ICredential - var result = (await response); - WriteObject(result, false); - } - } - } -} \ No newline at end of file diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/UpdateAzDeviceRegistryCredentials_UpdateViaJsonString.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/UpdateAzDeviceRegistryCredentials_UpdateViaJsonString.cs deleted file mode 100644 index f9a4404a659e..000000000000 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/UpdateAzDeviceRegistryCredentials_UpdateViaJsonString.cs +++ /dev/null @@ -1,573 +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.DeviceRegistry.Cmdlets -{ - using static Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Extensions; - using Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.PowerShell; - using Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Cmdlets; - using System; - - /// update a Credential - /// - /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/credentials/default" - /// - [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzDeviceRegistryCredentials_UpdateViaJsonString", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ICredential))] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Description(@"update a Credential")] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/credentials/default", ApiVersion = "2025-11-01-preview")] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.NotSuggestDefaultParameterSet] - public partial class UpdateAzDeviceRegistryCredentials_UpdateViaJsonString : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener, - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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(); - - /// 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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.DeviceRegistry Client => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.ParameterCategory.Runtime)] - public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.ParameterCategory.Runtime)] - public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } - - /// Accessor for our copy of the InvocationInfo. - public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } - - /// Backing field for property. - private string _jsonString; - - /// Json string supplied to the Update operation - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Json string supplied to the Update operation")] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"Json string supplied to the Update operation", - SerializedName = @"JsonString", - PossibleTypes = new [] { typeof(string) })] - public string JsonString { get => this._jsonString; set => this._jsonString = value; } - - /// - /// cancellation delegate. Stops the cmdlet when called. - /// - global::System.Action Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; - - /// cancellation token. - global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener.Token => _cancellationTokenSource.Token; - - /// Backing field for property. - private string _namespaceName; - - /// The name of the namespace. - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the namespace.")] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The name of the namespace.", - SerializedName = @"namespaceName", - PossibleTypes = new [] { typeof(string) })] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.ParameterCategory.Path)] - public string NamespaceName { get => this._namespaceName; set => this._namespaceName = value; } - - /// - /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue - /// asynchronously. - /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The name of the resource group. The name is case insensitive.", - SerializedName = @"resourceGroupName", - PossibleTypes = new [] { typeof(string) })] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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. The value must be an UUID. - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription. The value must be an UUID.")] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The ID of the target subscription. The value must be an UUID.", - SerializedName = @"subscriptionId", - PossibleTypes = new [] { typeof(string) })] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.DefaultInfo( - Name = @"", - Description =@"", - Script = @"(Get-AzContext).Subscription.Id", - SetCondition = @"")] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.Models.ICredential - /// 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.DeviceRegistry.Module.Instance.GetTelemetryId.Invoke(); - if (telemetryId != "" && telemetryId != "internal") - { - __correlationId = telemetryId; - } - Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); - if (Break) - { - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.AttachDebugger.Break(); - } - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - } - - /// Creates a duplicate instance of this cmdlet (via JSON serialization). - /// a duplicate instance of UpdateAzDeviceRegistryCredentials_UpdateViaJsonString - public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Cmdlets.UpdateAzDeviceRegistryCredentials_UpdateViaJsonString Clone() - { - var clone = new UpdateAzDeviceRegistryCredentials_UpdateViaJsonString(); - 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.NamespaceName = this.NamespaceName; - clone.JsonString = this.JsonString; - return clone; - } - - /// Performs clean-up after the command execution - protected override void EndProcessing() - { - var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.Runtime.Events.Verbose: - { - WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.Warning: - { - WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.Events.Debug: - { - WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - __processRecordId = System.Guid.NewGuid().ToString(); - try - { - // work - if (ShouldProcess($"Call remote 'CredentialsUpdate' operation")) - { - if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) - { - var instance = this.Clone(); - var job = new Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Token) ) - { - asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); - if (null != HttpPipelinePrepend) - { - Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); - } - if (null != HttpPipelineAppend) - { - Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); - } - // get the client instance - try - { - await ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.CredentialsUpdateViaJsonString(SubscriptionId, ResourceGroupName, NamespaceName, _jsonString, onOk, onDefault, this, Pipeline); - await ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - } - catch (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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,NamespaceName=NamespaceName}) - { - ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } - }); - } - finally - { - await ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletProcessRecordAsyncEnd); - } - } - } - - /// Interrupts currently running code within the command. - protected override void StopProcessing() - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Cancel(); - base.StopProcessing(); - } - - /// - /// Initializes a new instance of the cmdlet class. - /// - public UpdateAzDeviceRegistryCredentials_UpdateViaJsonString() - { - - } - - /// - new protected void WriteObject(object sendToPipeline) - { - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); - base.WriteObject(sendToPipeline); - } - - /// - /// - new protected void WriteObject(object sendToPipeline, bool enumerateCollection) - { - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.Models.ICredential - /// 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.DeviceRegistry.Models.ICredential - var result = (await response); - WriteObject(result, false); - } - } - } -} \ No newline at end of file diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/UpdateAzDeviceRegistryNamespaceAsset_UpdateExpanded.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/UpdateAzDeviceRegistryNamespaceAsset_UpdateExpanded.cs index d87700062db7..3c295d56ef4c 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/UpdateAzDeviceRegistryNamespaceAsset_UpdateExpanded.cs +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/UpdateAzDeviceRegistryNamespaceAsset_UpdateExpanded.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceAsset))] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Description(@"update a NamespaceAsset")] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/assets/{assetName}", ApiVersion = "2025-11-01-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/assets/{assetName}", ApiVersion = "2025-10-01")] public partial class UpdateAzDeviceRegistryNamespaceAsset_UpdateExpanded : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IContext diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/UpdateAzDeviceRegistryNamespaceAsset_UpdateViaIdentityExpanded.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/UpdateAzDeviceRegistryNamespaceAsset_UpdateViaIdentityExpanded.cs index 87d999fbf039..abaae3837c49 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/UpdateAzDeviceRegistryNamespaceAsset_UpdateViaIdentityExpanded.cs +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/UpdateAzDeviceRegistryNamespaceAsset_UpdateViaIdentityExpanded.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceAsset))] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Description(@"update a NamespaceAsset")] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/assets/{assetName}", ApiVersion = "2025-11-01-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/assets/{assetName}", ApiVersion = "2025-10-01")] public partial class UpdateAzDeviceRegistryNamespaceAsset_UpdateViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IContext diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/UpdateAzDeviceRegistryNamespaceAsset_UpdateViaIdentityNamespaceExpanded.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/UpdateAzDeviceRegistryNamespaceAsset_UpdateViaIdentityNamespaceExpanded.cs index d2c203e602d5..0a8733f7daff 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/UpdateAzDeviceRegistryNamespaceAsset_UpdateViaIdentityNamespaceExpanded.cs +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/UpdateAzDeviceRegistryNamespaceAsset_UpdateViaIdentityNamespaceExpanded.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceAsset))] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Description(@"update a NamespaceAsset")] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/assets/{assetName}", ApiVersion = "2025-11-01-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/assets/{assetName}", ApiVersion = "2025-10-01")] public partial class UpdateAzDeviceRegistryNamespaceAsset_UpdateViaIdentityNamespaceExpanded : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IContext diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/UpdateAzDeviceRegistryNamespaceAsset_UpdateViaJsonFilePath.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/UpdateAzDeviceRegistryNamespaceAsset_UpdateViaJsonFilePath.cs index e0fa0c8de3de..4d9d19c07cd2 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/UpdateAzDeviceRegistryNamespaceAsset_UpdateViaJsonFilePath.cs +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/UpdateAzDeviceRegistryNamespaceAsset_UpdateViaJsonFilePath.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceAsset))] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Description(@"update a NamespaceAsset")] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/assets/{assetName}", ApiVersion = "2025-11-01-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/assets/{assetName}", ApiVersion = "2025-10-01")] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.NotSuggestDefaultParameterSet] public partial class UpdateAzDeviceRegistryNamespaceAsset_UpdateViaJsonFilePath : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener, diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/UpdateAzDeviceRegistryNamespaceAsset_UpdateViaJsonString.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/UpdateAzDeviceRegistryNamespaceAsset_UpdateViaJsonString.cs index 2cd36743d5e8..3ed5dee2589e 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/UpdateAzDeviceRegistryNamespaceAsset_UpdateViaJsonString.cs +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/UpdateAzDeviceRegistryNamespaceAsset_UpdateViaJsonString.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceAsset))] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Description(@"update a NamespaceAsset")] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/assets/{assetName}", ApiVersion = "2025-11-01-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/assets/{assetName}", ApiVersion = "2025-10-01")] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.NotSuggestDefaultParameterSet] public partial class UpdateAzDeviceRegistryNamespaceAsset_UpdateViaJsonString : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener, diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/UpdateAzDeviceRegistryNamespaceDevice_UpdateExpanded.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/UpdateAzDeviceRegistryNamespaceDevice_UpdateExpanded.cs index 4afad967c4ad..3b7900b36ac7 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/UpdateAzDeviceRegistryNamespaceDevice_UpdateExpanded.cs +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/UpdateAzDeviceRegistryNamespaceDevice_UpdateExpanded.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDevice))] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Description(@"update a NamespaceDevice")] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/devices/{deviceName}", ApiVersion = "2025-11-01-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/devices/{deviceName}", ApiVersion = "2025-10-01")] public partial class UpdateAzDeviceRegistryNamespaceDevice_UpdateExpanded : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IContext @@ -209,17 +209,6 @@ public partial class UpdateAzDeviceRegistryNamespaceDevice_UpdateExpanded : glob /// public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.HttpPipeline Pipeline { get; set; } - /// Resource Id of the Policy. - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Resource Id of the Policy.")] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Resource Id of the Policy.", - SerializedName = @"resourceId", - PossibleTypes = new [] { typeof(string) })] - public string PolicyResourceId { get => _propertiesBody.PolicyResourceId ?? null; set => _propertiesBody.PolicyResourceId = 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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.ParameterCategory.Runtime)] diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/UpdateAzDeviceRegistryNamespaceDevice_UpdateViaIdentityExpanded.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/UpdateAzDeviceRegistryNamespaceDevice_UpdateViaIdentityExpanded.cs index 5235050781e8..3ba0119e10ef 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/UpdateAzDeviceRegistryNamespaceDevice_UpdateViaIdentityExpanded.cs +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/UpdateAzDeviceRegistryNamespaceDevice_UpdateViaIdentityExpanded.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDevice))] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Description(@"update a NamespaceDevice")] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/devices/{deviceName}", ApiVersion = "2025-11-01-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/devices/{deviceName}", ApiVersion = "2025-10-01")] public partial class UpdateAzDeviceRegistryNamespaceDevice_UpdateViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IContext @@ -189,17 +189,6 @@ public partial class UpdateAzDeviceRegistryNamespaceDevice_UpdateViaIdentityExpa /// public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.HttpPipeline Pipeline { get; set; } - /// Resource Id of the Policy. - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Resource Id of the Policy.")] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Resource Id of the Policy.", - SerializedName = @"resourceId", - PossibleTypes = new [] { typeof(string) })] - public string PolicyResourceId { get => _propertiesBody.PolicyResourceId ?? null; set => _propertiesBody.PolicyResourceId = 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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.ParameterCategory.Runtime)] diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/UpdateAzDeviceRegistryNamespaceDevice_UpdateViaIdentityNamespaceExpanded.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/UpdateAzDeviceRegistryNamespaceDevice_UpdateViaIdentityNamespaceExpanded.cs index dceebf9a7a72..fc57c82c4b84 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/UpdateAzDeviceRegistryNamespaceDevice_UpdateViaIdentityNamespaceExpanded.cs +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/UpdateAzDeviceRegistryNamespaceDevice_UpdateViaIdentityNamespaceExpanded.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDevice))] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Description(@"update a NamespaceDevice")] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/devices/{deviceName}", ApiVersion = "2025-11-01-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/devices/{deviceName}", ApiVersion = "2025-10-01")] public partial class UpdateAzDeviceRegistryNamespaceDevice_UpdateViaIdentityNamespaceExpanded : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IContext @@ -203,17 +203,6 @@ public partial class UpdateAzDeviceRegistryNamespaceDevice_UpdateViaIdentityName /// public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.HttpPipeline Pipeline { get; set; } - /// Resource Id of the Policy. - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Resource Id of the Policy.")] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Resource Id of the Policy.", - SerializedName = @"resourceId", - PossibleTypes = new [] { typeof(string) })] - public string PolicyResourceId { get => _propertiesBody.PolicyResourceId ?? null; set => _propertiesBody.PolicyResourceId = 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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.ParameterCategory.Runtime)] diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/UpdateAzDeviceRegistryNamespaceDevice_UpdateViaJsonFilePath.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/UpdateAzDeviceRegistryNamespaceDevice_UpdateViaJsonFilePath.cs index 53de49ca41eb..3330a7c139b9 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/UpdateAzDeviceRegistryNamespaceDevice_UpdateViaJsonFilePath.cs +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/UpdateAzDeviceRegistryNamespaceDevice_UpdateViaJsonFilePath.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDevice))] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Description(@"update a NamespaceDevice")] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/devices/{deviceName}", ApiVersion = "2025-11-01-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/devices/{deviceName}", ApiVersion = "2025-10-01")] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.NotSuggestDefaultParameterSet] public partial class UpdateAzDeviceRegistryNamespaceDevice_UpdateViaJsonFilePath : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener, diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/UpdateAzDeviceRegistryNamespaceDevice_UpdateViaJsonString.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/UpdateAzDeviceRegistryNamespaceDevice_UpdateViaJsonString.cs index dbb83243b6ea..f6891e569a2d 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/UpdateAzDeviceRegistryNamespaceDevice_UpdateViaJsonString.cs +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/UpdateAzDeviceRegistryNamespaceDevice_UpdateViaJsonString.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDevice))] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Description(@"update a NamespaceDevice")] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/devices/{deviceName}", ApiVersion = "2025-11-01-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/devices/{deviceName}", ApiVersion = "2025-10-01")] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.NotSuggestDefaultParameterSet] public partial class UpdateAzDeviceRegistryNamespaceDevice_UpdateViaJsonString : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener, diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/UpdateAzDeviceRegistryNamespaceDiscoveredAsset_UpdateExpanded.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/UpdateAzDeviceRegistryNamespaceDiscoveredAsset_UpdateExpanded.cs index d163a7449902..d9ca58d08255 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/UpdateAzDeviceRegistryNamespaceDiscoveredAsset_UpdateExpanded.cs +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/UpdateAzDeviceRegistryNamespaceDiscoveredAsset_UpdateExpanded.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDiscoveredAsset))] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Description(@"update a NamespaceDiscoveredAsset")] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/discoveredAssets/{discoveredAssetName}", ApiVersion = "2025-11-01-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/discoveredAssets/{discoveredAssetName}", ApiVersion = "2025-10-01")] public partial class UpdateAzDeviceRegistryNamespaceDiscoveredAsset_UpdateExpanded : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IContext diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/UpdateAzDeviceRegistryNamespaceDiscoveredAsset_UpdateViaIdentityExpanded.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/UpdateAzDeviceRegistryNamespaceDiscoveredAsset_UpdateViaIdentityExpanded.cs index f23ad0aff3c1..ae1e715950c2 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/UpdateAzDeviceRegistryNamespaceDiscoveredAsset_UpdateViaIdentityExpanded.cs +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/UpdateAzDeviceRegistryNamespaceDiscoveredAsset_UpdateViaIdentityExpanded.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDiscoveredAsset))] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Description(@"update a NamespaceDiscoveredAsset")] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/discoveredAssets/{discoveredAssetName}", ApiVersion = "2025-11-01-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/discoveredAssets/{discoveredAssetName}", ApiVersion = "2025-10-01")] public partial class UpdateAzDeviceRegistryNamespaceDiscoveredAsset_UpdateViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IContext diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/UpdateAzDeviceRegistryNamespaceDiscoveredAsset_UpdateViaIdentityNamespaceExpanded.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/UpdateAzDeviceRegistryNamespaceDiscoveredAsset_UpdateViaIdentityNamespaceExpanded.cs index b5ad49552662..a709a26dde75 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/UpdateAzDeviceRegistryNamespaceDiscoveredAsset_UpdateViaIdentityNamespaceExpanded.cs +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/UpdateAzDeviceRegistryNamespaceDiscoveredAsset_UpdateViaIdentityNamespaceExpanded.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDiscoveredAsset))] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Description(@"update a NamespaceDiscoveredAsset")] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/discoveredAssets/{discoveredAssetName}", ApiVersion = "2025-11-01-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/discoveredAssets/{discoveredAssetName}", ApiVersion = "2025-10-01")] public partial class UpdateAzDeviceRegistryNamespaceDiscoveredAsset_UpdateViaIdentityNamespaceExpanded : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IContext diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/UpdateAzDeviceRegistryNamespaceDiscoveredAsset_UpdateViaJsonFilePath.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/UpdateAzDeviceRegistryNamespaceDiscoveredAsset_UpdateViaJsonFilePath.cs index 921c8403b0ef..68eefcca7e6c 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/UpdateAzDeviceRegistryNamespaceDiscoveredAsset_UpdateViaJsonFilePath.cs +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/UpdateAzDeviceRegistryNamespaceDiscoveredAsset_UpdateViaJsonFilePath.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDiscoveredAsset))] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Description(@"update a NamespaceDiscoveredAsset")] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/discoveredAssets/{discoveredAssetName}", ApiVersion = "2025-11-01-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/discoveredAssets/{discoveredAssetName}", ApiVersion = "2025-10-01")] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.NotSuggestDefaultParameterSet] public partial class UpdateAzDeviceRegistryNamespaceDiscoveredAsset_UpdateViaJsonFilePath : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener, diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/UpdateAzDeviceRegistryNamespaceDiscoveredAsset_UpdateViaJsonString.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/UpdateAzDeviceRegistryNamespaceDiscoveredAsset_UpdateViaJsonString.cs index 42c8eaab7cfe..c20b1955cf5c 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/UpdateAzDeviceRegistryNamespaceDiscoveredAsset_UpdateViaJsonString.cs +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/UpdateAzDeviceRegistryNamespaceDiscoveredAsset_UpdateViaJsonString.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDiscoveredAsset))] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Description(@"update a NamespaceDiscoveredAsset")] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/discoveredAssets/{discoveredAssetName}", ApiVersion = "2025-11-01-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/discoveredAssets/{discoveredAssetName}", ApiVersion = "2025-10-01")] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.NotSuggestDefaultParameterSet] public partial class UpdateAzDeviceRegistryNamespaceDiscoveredAsset_UpdateViaJsonString : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener, diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/UpdateAzDeviceRegistryNamespaceDiscoveredDevice_UpdateExpanded.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/UpdateAzDeviceRegistryNamespaceDiscoveredDevice_UpdateExpanded.cs index 11d5816c58ee..5ed587e1846f 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/UpdateAzDeviceRegistryNamespaceDiscoveredDevice_UpdateExpanded.cs +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/UpdateAzDeviceRegistryNamespaceDiscoveredDevice_UpdateExpanded.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDiscoveredDevice))] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Description(@"update a NamespaceDiscoveredDevice")] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/discoveredDevices/{discoveredDeviceName}", ApiVersion = "2025-11-01-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/discoveredDevices/{discoveredDeviceName}", ApiVersion = "2025-10-01")] public partial class UpdateAzDeviceRegistryNamespaceDiscoveredDevice_UpdateExpanded : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IContext diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/UpdateAzDeviceRegistryNamespaceDiscoveredDevice_UpdateViaIdentityExpanded.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/UpdateAzDeviceRegistryNamespaceDiscoveredDevice_UpdateViaIdentityExpanded.cs index 3eeda9e1be0f..d1b74d7557f9 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/UpdateAzDeviceRegistryNamespaceDiscoveredDevice_UpdateViaIdentityExpanded.cs +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/UpdateAzDeviceRegistryNamespaceDiscoveredDevice_UpdateViaIdentityExpanded.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDiscoveredDevice))] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Description(@"update a NamespaceDiscoveredDevice")] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/discoveredDevices/{discoveredDeviceName}", ApiVersion = "2025-11-01-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/discoveredDevices/{discoveredDeviceName}", ApiVersion = "2025-10-01")] public partial class UpdateAzDeviceRegistryNamespaceDiscoveredDevice_UpdateViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IContext diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/UpdateAzDeviceRegistryNamespaceDiscoveredDevice_UpdateViaIdentityNamespaceExpanded.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/UpdateAzDeviceRegistryNamespaceDiscoveredDevice_UpdateViaIdentityNamespaceExpanded.cs index 6360de989be3..1231e0691954 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/UpdateAzDeviceRegistryNamespaceDiscoveredDevice_UpdateViaIdentityNamespaceExpanded.cs +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/UpdateAzDeviceRegistryNamespaceDiscoveredDevice_UpdateViaIdentityNamespaceExpanded.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDiscoveredDevice))] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Description(@"update a NamespaceDiscoveredDevice")] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/discoveredDevices/{discoveredDeviceName}", ApiVersion = "2025-11-01-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/discoveredDevices/{discoveredDeviceName}", ApiVersion = "2025-10-01")] public partial class UpdateAzDeviceRegistryNamespaceDiscoveredDevice_UpdateViaIdentityNamespaceExpanded : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IContext diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/UpdateAzDeviceRegistryNamespaceDiscoveredDevice_UpdateViaJsonFilePath.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/UpdateAzDeviceRegistryNamespaceDiscoveredDevice_UpdateViaJsonFilePath.cs index 66659e5bb053..f83cf2a756e7 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/UpdateAzDeviceRegistryNamespaceDiscoveredDevice_UpdateViaJsonFilePath.cs +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/UpdateAzDeviceRegistryNamespaceDiscoveredDevice_UpdateViaJsonFilePath.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDiscoveredDevice))] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Description(@"update a NamespaceDiscoveredDevice")] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/discoveredDevices/{discoveredDeviceName}", ApiVersion = "2025-11-01-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/discoveredDevices/{discoveredDeviceName}", ApiVersion = "2025-10-01")] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.NotSuggestDefaultParameterSet] public partial class UpdateAzDeviceRegistryNamespaceDiscoveredDevice_UpdateViaJsonFilePath : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener, diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/UpdateAzDeviceRegistryNamespaceDiscoveredDevice_UpdateViaJsonString.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/UpdateAzDeviceRegistryNamespaceDiscoveredDevice_UpdateViaJsonString.cs index d827eb9fd5ae..8dd4c1643e1d 100644 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/UpdateAzDeviceRegistryNamespaceDiscoveredDevice_UpdateViaJsonString.cs +++ b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/UpdateAzDeviceRegistryNamespaceDiscoveredDevice_UpdateViaJsonString.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.INamespaceDiscoveredDevice))] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Description(@"update a NamespaceDiscoveredDevice")] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/discoveredDevices/{discoveredDeviceName}", ApiVersion = "2025-11-01-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/discoveredDevices/{discoveredDeviceName}", ApiVersion = "2025-10-01")] [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.NotSuggestDefaultParameterSet] public partial class UpdateAzDeviceRegistryNamespaceDiscoveredDevice_UpdateViaJsonString : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener, diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/UpdateAzDeviceRegistryPolicy_UpdateExpanded.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/UpdateAzDeviceRegistryPolicy_UpdateExpanded.cs deleted file mode 100644 index 95221aaa3be3..000000000000 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/UpdateAzDeviceRegistryPolicy_UpdateExpanded.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.DeviceRegistry.Cmdlets -{ - using static Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Extensions; - using Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.PowerShell; - using Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Cmdlets; - using System; - - /// update a Policy - /// - /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/credentials/default/policies/{policyName}" - /// - [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzDeviceRegistryPolicy_UpdateExpanded", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicy))] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Description(@"update a Policy")] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/credentials/default/policies/{policyName}", ApiVersion = "2025-11-01-preview")] - public partial class UpdateAzDeviceRegistryPolicy_UpdateExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener, - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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(); - - /// The type used for update operations of the Policy. - private Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyUpdate _propertiesBody = new Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.PolicyUpdate(); - - /// 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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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 configuration to set up an ICA. - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The configuration to set up an ICA.")] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The configuration to set up an ICA.", - SerializedName = @"certificateAuthorityConfiguration", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAny) })] - public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAny CertificateAuthorityConfiguration { get => _propertiesBody.CertificateAuthorityConfiguration ?? null /* object */; set => _propertiesBody.CertificateAuthorityConfiguration = value; } - - /// The reference to the client API class. - public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.DeviceRegistry Client => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.ParameterCategory.Runtime)] - public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.ParameterCategory.Runtime)] - public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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 validity period in days. - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The validity period in days.")] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The validity period in days.", - SerializedName = @"validityPeriodInDays", - PossibleTypes = new [] { typeof(int) })] - public int LeafCertificateConfigurationValidityPeriodInDay { get => _propertiesBody.LeafCertificateConfigurationValidityPeriodInDay ?? default(int); set => _propertiesBody.LeafCertificateConfigurationValidityPeriodInDay = value; } - - /// - /// cancellation delegate. Stops the cmdlet when called. - /// - global::System.Action Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; - - /// cancellation token. - global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener.Token => _cancellationTokenSource.Token; - - /// Backing field for property. - private string _name; - - /// The name of the Policy tracked resource. - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the Policy tracked resource.")] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The name of the Policy tracked resource.", - SerializedName = @"policyName", - PossibleTypes = new [] { typeof(string) })] - [global::System.Management.Automation.Alias("PolicyName")] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.ParameterCategory.Path)] - public string Name { get => this._name; set => this._name = value; } - - /// Backing field for property. - private string _namespaceName; - - /// The name of the namespace. - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the namespace.")] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The name of the namespace.", - SerializedName = @"namespaceName", - PossibleTypes = new [] { typeof(string) })] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.ParameterCategory.Path)] - public string NamespaceName { get => this._namespaceName; set => this._namespaceName = value; } - - /// - /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue - /// asynchronously. - /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The name of the resource group. The name is case insensitive.", - SerializedName = @"resourceGroupName", - PossibleTypes = new [] { typeof(string) })] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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. The value must be an UUID. - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription. The value must be an UUID.")] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The ID of the target subscription. The value must be an UUID.", - SerializedName = @"subscriptionId", - PossibleTypes = new [] { typeof(string) })] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.DefaultInfo( - Name = @"", - Description =@"", - Script = @"(Get-AzContext).Subscription.Id", - SetCondition = @"")] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.ParameterCategory.Path)] - public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } - - /// Resource tags. - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.ExportAs(typeof(global::System.Collections.Hashtable))] - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Resource tags.")] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Resource tags.", - SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyUpdateTags) })] - public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyUpdateTags Tag { get => _propertiesBody.Tag ?? null /* object */; set => _propertiesBody.Tag = 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.DeviceRegistry.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.DeviceRegistry.Models.IPolicy - /// 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.DeviceRegistry.Module.Instance.GetTelemetryId.Invoke(); - if (telemetryId != "" && telemetryId != "internal") - { - __correlationId = telemetryId; - } - Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); - if (Break) - { - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.AttachDebugger.Break(); - } - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - } - - /// Creates a duplicate instance of this cmdlet (via JSON serialization). - /// a duplicate instance of UpdateAzDeviceRegistryPolicy_UpdateExpanded - public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Cmdlets.UpdateAzDeviceRegistryPolicy_UpdateExpanded Clone() - { - var clone = new UpdateAzDeviceRegistryPolicy_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._propertiesBody = this._propertiesBody; - clone.SubscriptionId = this.SubscriptionId; - clone.ResourceGroupName = this.ResourceGroupName; - clone.NamespaceName = this.NamespaceName; - clone.Name = this.Name; - return clone; - } - - /// Performs clean-up after the command execution - protected override void EndProcessing() - { - var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.Runtime.Events.Verbose: - { - WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.Warning: - { - WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.Events.Debug: - { - WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - __processRecordId = System.Guid.NewGuid().ToString(); - try - { - // work - if (ShouldProcess($"Call remote 'PoliciesUpdate' operation")) - { - if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) - { - var instance = this.Clone(); - var job = new Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Token) ) - { - asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); - if (null != HttpPipelinePrepend) - { - Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); - } - if (null != HttpPipelineAppend) - { - Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); - } - // get the client instance - try - { - await ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.PoliciesUpdate(SubscriptionId, ResourceGroupName, NamespaceName, Name, _propertiesBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeUpdate); - await ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - } - catch (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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,NamespaceName=NamespaceName,Name=Name}) - { - ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } - }); - } - finally - { - await ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletProcessRecordAsyncEnd); - } - } - } - - /// Interrupts currently running code within the command. - protected override void StopProcessing() - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Cancel(); - base.StopProcessing(); - } - - /// - /// Initializes a new instance of the cmdlet class. - /// - public UpdateAzDeviceRegistryPolicy_UpdateExpanded() - { - - } - - /// - new protected void WriteObject(object sendToPipeline) - { - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); - base.WriteObject(sendToPipeline); - } - - /// - /// - new protected void WriteObject(object sendToPipeline, bool enumerateCollection) - { - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.Models.IPolicy - /// 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.DeviceRegistry.Models.IPolicy - var result = (await response); - WriteObject(result, false); - } - } - } -} \ No newline at end of file diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/UpdateAzDeviceRegistryPolicy_UpdateViaIdentityExpanded.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/UpdateAzDeviceRegistryPolicy_UpdateViaIdentityExpanded.cs deleted file mode 100644 index 930f7fdcb6ea..000000000000 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/UpdateAzDeviceRegistryPolicy_UpdateViaIdentityExpanded.cs +++ /dev/null @@ -1,578 +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.DeviceRegistry.Cmdlets -{ - using static Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Extensions; - using Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.PowerShell; - using Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Cmdlets; - using System; - - /// update a Policy - /// - /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/credentials/default/policies/{policyName}" - /// - [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzDeviceRegistryPolicy_UpdateViaIdentityExpanded", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicy))] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Description(@"update a Policy")] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/credentials/default/policies/{policyName}", ApiVersion = "2025-11-01-preview")] - public partial class UpdateAzDeviceRegistryPolicy_UpdateViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener, - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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(); - - /// The type used for update operations of the Policy. - private Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyUpdate _propertiesBody = new Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.PolicyUpdate(); - - /// 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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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 configuration to set up an ICA. - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The configuration to set up an ICA.")] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The configuration to set up an ICA.", - SerializedName = @"certificateAuthorityConfiguration", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAny) })] - public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAny CertificateAuthorityConfiguration { get => _propertiesBody.CertificateAuthorityConfiguration ?? null /* object */; set => _propertiesBody.CertificateAuthorityConfiguration = value; } - - /// The reference to the client API class. - public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.DeviceRegistry Client => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.ParameterCategory.Runtime)] - public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.ParameterCategory.Runtime)] - public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IDeviceRegistryIdentity _inputObject; - - /// Identity Parameter - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.ParameterCategory.Path)] - public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IDeviceRegistryIdentity 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 validity period in days. - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The validity period in days.")] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The validity period in days.", - SerializedName = @"validityPeriodInDays", - PossibleTypes = new [] { typeof(int) })] - public int LeafCertificateConfigurationValidityPeriodInDay { get => _propertiesBody.LeafCertificateConfigurationValidityPeriodInDay ?? default(int); set => _propertiesBody.LeafCertificateConfigurationValidityPeriodInDay = value; } - - /// - /// cancellation delegate. Stops the cmdlet when called. - /// - global::System.Action Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; - - /// cancellation token. - global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.ParameterCategory.Runtime)] - public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } - - /// Resource tags. - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.ExportAs(typeof(global::System.Collections.Hashtable))] - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Resource tags.")] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Resource tags.", - SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyUpdateTags) })] - public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyUpdateTags Tag { get => _propertiesBody.Tag ?? null /* object */; set => _propertiesBody.Tag = 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.DeviceRegistry.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.DeviceRegistry.Models.IPolicy - /// 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.DeviceRegistry.Module.Instance.GetTelemetryId.Invoke(); - if (telemetryId != "" && telemetryId != "internal") - { - __correlationId = telemetryId; - } - Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); - if (Break) - { - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.AttachDebugger.Break(); - } - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - } - - /// Creates a duplicate instance of this cmdlet (via JSON serialization). - /// a duplicate instance of UpdateAzDeviceRegistryPolicy_UpdateViaIdentityExpanded - public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Cmdlets.UpdateAzDeviceRegistryPolicy_UpdateViaIdentityExpanded Clone() - { - var clone = new UpdateAzDeviceRegistryPolicy_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._propertiesBody = this._propertiesBody; - return clone; - } - - /// Performs clean-up after the command execution - protected override void EndProcessing() - { - var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.Runtime.Events.Verbose: - { - WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.Warning: - { - WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.Events.Debug: - { - WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - __processRecordId = System.Guid.NewGuid().ToString(); - try - { - // work - if (ShouldProcess($"Call remote 'PoliciesUpdate' operation")) - { - if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) - { - var instance = this.Clone(); - var job = new Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Token) ) - { - asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); - if (null != HttpPipelinePrepend) - { - Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); - } - if (null != HttpPipelineAppend) - { - Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); - } - // get the client instance - try - { - await ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - if (InputObject?.Id != null) - { - await this.Client.PoliciesUpdateViaIdentity(InputObject.Id, _propertiesBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.NamespaceName) - { - ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.NamespaceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); - } - if (null == InputObject.PolicyName) - { - ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.PolicyName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); - } - await this.Client.PoliciesUpdate(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.NamespaceName ?? null, InputObject.PolicyName ?? null, _propertiesBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeUpdate); - } - await ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - } - catch (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletProcessRecordAsyncEnd); - } - } - } - - /// Interrupts currently running code within the command. - protected override void StopProcessing() - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Cancel(); - base.StopProcessing(); - } - - /// - /// Initializes a new instance of the cmdlet class. - /// - public UpdateAzDeviceRegistryPolicy_UpdateViaIdentityExpanded() - { - - } - - /// - new protected void WriteObject(object sendToPipeline) - { - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); - base.WriteObject(sendToPipeline); - } - - /// - /// - new protected void WriteObject(object sendToPipeline, bool enumerateCollection) - { - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.Models.IPolicy - /// 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.DeviceRegistry.Models.IPolicy - var result = (await response); - WriteObject(result, false); - } - } - } -} \ No newline at end of file diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/UpdateAzDeviceRegistryPolicy_UpdateViaIdentityNamespaceExpanded.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/UpdateAzDeviceRegistryPolicy_UpdateViaIdentityNamespaceExpanded.cs deleted file mode 100644 index ee785272ebf8..000000000000 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/UpdateAzDeviceRegistryPolicy_UpdateViaIdentityNamespaceExpanded.cs +++ /dev/null @@ -1,594 +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.DeviceRegistry.Cmdlets -{ - using static Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Extensions; - using Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.PowerShell; - using Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Cmdlets; - using System; - - /// update a Policy - /// - /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/credentials/default/policies/{policyName}" - /// - [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzDeviceRegistryPolicy_UpdateViaIdentityNamespaceExpanded", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicy))] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Description(@"update a Policy")] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/credentials/default/policies/{policyName}", ApiVersion = "2025-11-01-preview")] - public partial class UpdateAzDeviceRegistryPolicy_UpdateViaIdentityNamespaceExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener, - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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(); - - /// The type used for update operations of the Policy. - private Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyUpdate _propertiesBody = new Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.PolicyUpdate(); - - /// 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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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 configuration to set up an ICA. - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The configuration to set up an ICA.")] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The configuration to set up an ICA.", - SerializedName = @"certificateAuthorityConfiguration", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAny) })] - public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAny CertificateAuthorityConfiguration { get => _propertiesBody.CertificateAuthorityConfiguration ?? null /* object */; set => _propertiesBody.CertificateAuthorityConfiguration = value; } - - /// The reference to the client API class. - public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.DeviceRegistry Client => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.ParameterCategory.Runtime)] - public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.ParameterCategory.Runtime)] - public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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 validity period in days. - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The validity period in days.")] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The validity period in days.", - SerializedName = @"validityPeriodInDays", - PossibleTypes = new [] { typeof(int) })] - public int LeafCertificateConfigurationValidityPeriodInDay { get => _propertiesBody.LeafCertificateConfigurationValidityPeriodInDay ?? default(int); set => _propertiesBody.LeafCertificateConfigurationValidityPeriodInDay = value; } - - /// - /// cancellation delegate. Stops the cmdlet when called. - /// - global::System.Action Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; - - /// cancellation token. - global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener.Token => _cancellationTokenSource.Token; - - /// Backing field for property. - private string _name; - - /// The name of the Policy tracked resource. - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the Policy tracked resource.")] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The name of the Policy tracked resource.", - SerializedName = @"policyName", - PossibleTypes = new [] { typeof(string) })] - [global::System.Management.Automation.Alias("PolicyName")] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.ParameterCategory.Path)] - public string Name { get => this._name; set => this._name = value; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IDeviceRegistryIdentity _namespaceInputObject; - - /// Identity Parameter - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.ParameterCategory.Path)] - public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IDeviceRegistryIdentity NamespaceInputObject { get => this._namespaceInputObject; set => this._namespaceInputObject = value; } - - /// - /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue - /// asynchronously. - /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.ParameterCategory.Runtime)] - public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } - - /// Resource tags. - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.ExportAs(typeof(global::System.Collections.Hashtable))] - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Resource tags.")] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Resource tags.", - SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyUpdateTags) })] - public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicyUpdateTags Tag { get => _propertiesBody.Tag ?? null /* object */; set => _propertiesBody.Tag = 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.DeviceRegistry.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.DeviceRegistry.Models.IPolicy - /// 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.DeviceRegistry.Module.Instance.GetTelemetryId.Invoke(); - if (telemetryId != "" && telemetryId != "internal") - { - __correlationId = telemetryId; - } - Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); - if (Break) - { - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.AttachDebugger.Break(); - } - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - } - - /// Creates a duplicate instance of this cmdlet (via JSON serialization). - /// - /// a duplicate instance of UpdateAzDeviceRegistryPolicy_UpdateViaIdentityNamespaceExpanded - /// - public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Cmdlets.UpdateAzDeviceRegistryPolicy_UpdateViaIdentityNamespaceExpanded Clone() - { - var clone = new UpdateAzDeviceRegistryPolicy_UpdateViaIdentityNamespaceExpanded(); - 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._propertiesBody = this._propertiesBody; - clone.Name = this.Name; - return clone; - } - - /// Performs clean-up after the command execution - protected override void EndProcessing() - { - var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.Runtime.Events.Verbose: - { - WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.Warning: - { - WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.Events.Debug: - { - WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - __processRecordId = System.Guid.NewGuid().ToString(); - try - { - // work - if (ShouldProcess($"Call remote 'PoliciesUpdate' operation")) - { - if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) - { - var instance = this.Clone(); - var job = new Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Token) ) - { - asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); - if (null != HttpPipelinePrepend) - { - Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); - } - if (null != HttpPipelineAppend) - { - Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); - } - // get the client instance - try - { - await ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - if (NamespaceInputObject?.Id != null) - { - this.NamespaceInputObject.Id += $"/policies/{(global::System.Uri.EscapeDataString(this.Name.ToString()))}"; - await this.Client.PoliciesUpdateViaIdentity(NamespaceInputObject.Id, _propertiesBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeUpdate); - } - else - { - // try to call with PATH parameters from Input Object - if (null == NamespaceInputObject.SubscriptionId) - { - ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("NamespaceInputObject has null value for NamespaceInputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, NamespaceInputObject) ); - } - if (null == NamespaceInputObject.ResourceGroupName) - { - ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("NamespaceInputObject has null value for NamespaceInputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, NamespaceInputObject) ); - } - if (null == NamespaceInputObject.NamespaceName) - { - ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("NamespaceInputObject has null value for NamespaceInputObject.NamespaceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, NamespaceInputObject) ); - } - await this.Client.PoliciesUpdate(NamespaceInputObject.SubscriptionId ?? null, NamespaceInputObject.ResourceGroupName ?? null, NamespaceInputObject.NamespaceName ?? null, Name, _propertiesBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeUpdate); - } - await ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - } - catch (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.UndeclaredResponseException urexception) - { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Name=Name}) - { - ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } - }); - } - finally - { - await ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletProcessRecordAsyncEnd); - } - } - } - - /// Interrupts currently running code within the command. - protected override void StopProcessing() - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Cancel(); - base.StopProcessing(); - } - - /// - /// Initializes a new instance of the cmdlet - /// class. - /// - public UpdateAzDeviceRegistryPolicy_UpdateViaIdentityNamespaceExpanded() - { - - } - - /// - new protected void WriteObject(object sendToPipeline) - { - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); - base.WriteObject(sendToPipeline); - } - - /// - /// - new protected void WriteObject(object sendToPipeline, bool enumerateCollection) - { - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.Models.IPolicy - /// 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.DeviceRegistry.Models.IPolicy - var result = (await response); - WriteObject(result, false); - } - } - } -} \ No newline at end of file diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/UpdateAzDeviceRegistryPolicy_UpdateViaJsonFilePath.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/UpdateAzDeviceRegistryPolicy_UpdateViaJsonFilePath.cs deleted file mode 100644 index b4649ac1f74d..000000000000 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/UpdateAzDeviceRegistryPolicy_UpdateViaJsonFilePath.cs +++ /dev/null @@ -1,591 +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.DeviceRegistry.Cmdlets -{ - using static Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Extensions; - using Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.PowerShell; - using Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Cmdlets; - using System; - - /// update a Policy - /// - /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/credentials/default/policies/{policyName}" - /// - [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzDeviceRegistryPolicy_UpdateViaJsonFilePath", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicy))] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Description(@"update a Policy")] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/credentials/default/policies/{policyName}", ApiVersion = "2025-11-01-preview")] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.NotSuggestDefaultParameterSet] - public partial class UpdateAzDeviceRegistryPolicy_UpdateViaJsonFilePath : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener, - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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(); - - public global::System.String _jsonString; - - /// 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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.DeviceRegistry Client => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.ParameterCategory.Runtime)] - public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.ParameterCategory.Runtime)] - public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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 Update operation - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Path of Json file supplied to the Update operation")] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"Path of Json file supplied to the Update operation", - SerializedName = @"JsonFilePath", - PossibleTypes = new [] { typeof(string) })] - public string JsonFilePath { get => this._jsonFilePath; set { if (!System.IO.File.Exists(value)) { throw new Exception("Cannot find File " + value); } this._jsonString = System.IO.File.ReadAllText(value); this._jsonFilePath = value; } } - - /// - /// cancellation delegate. Stops the cmdlet when called. - /// - global::System.Action Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; - - /// cancellation token. - global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener.Token => _cancellationTokenSource.Token; - - /// Backing field for property. - private string _name; - - /// The name of the Policy tracked resource. - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the Policy tracked resource.")] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The name of the Policy tracked resource.", - SerializedName = @"policyName", - PossibleTypes = new [] { typeof(string) })] - [global::System.Management.Automation.Alias("PolicyName")] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.ParameterCategory.Path)] - public string Name { get => this._name; set => this._name = value; } - - /// Backing field for property. - private string _namespaceName; - - /// The name of the namespace. - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the namespace.")] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The name of the namespace.", - SerializedName = @"namespaceName", - PossibleTypes = new [] { typeof(string) })] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.ParameterCategory.Path)] - public string NamespaceName { get => this._namespaceName; set => this._namespaceName = value; } - - /// - /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue - /// asynchronously. - /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The name of the resource group. The name is case insensitive.", - SerializedName = @"resourceGroupName", - PossibleTypes = new [] { typeof(string) })] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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. The value must be an UUID. - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription. The value must be an UUID.")] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The ID of the target subscription. The value must be an UUID.", - SerializedName = @"subscriptionId", - PossibleTypes = new [] { typeof(string) })] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.DefaultInfo( - Name = @"", - Description =@"", - Script = @"(Get-AzContext).Subscription.Id", - SetCondition = @"")] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.Models.IPolicy - /// 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.DeviceRegistry.Module.Instance.GetTelemetryId.Invoke(); - if (telemetryId != "" && telemetryId != "internal") - { - __correlationId = telemetryId; - } - Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); - if (Break) - { - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.AttachDebugger.Break(); - } - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - } - - /// Creates a duplicate instance of this cmdlet (via JSON serialization). - /// a duplicate instance of UpdateAzDeviceRegistryPolicy_UpdateViaJsonFilePath - public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Cmdlets.UpdateAzDeviceRegistryPolicy_UpdateViaJsonFilePath Clone() - { - var clone = new UpdateAzDeviceRegistryPolicy_UpdateViaJsonFilePath(); - clone.__correlationId = this.__correlationId; - clone.__processRecordId = this.__processRecordId; - clone.DefaultProfile = this.DefaultProfile; - clone.InvocationInformation = this.InvocationInformation; - clone.Proxy = this.Proxy; - clone.Pipeline = this.Pipeline; - clone.AsJob = this.AsJob; - clone.Break = this.Break; - clone.ProxyCredential = this.ProxyCredential; - clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; - clone.HttpPipelinePrepend = this.HttpPipelinePrepend; - clone.HttpPipelineAppend = this.HttpPipelineAppend; - clone.SubscriptionId = this.SubscriptionId; - clone.ResourceGroupName = this.ResourceGroupName; - clone.NamespaceName = this.NamespaceName; - clone.Name = this.Name; - clone.JsonFilePath = this.JsonFilePath; - return clone; - } - - /// Performs clean-up after the command execution - protected override void EndProcessing() - { - var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.Runtime.Events.Verbose: - { - WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.Warning: - { - WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.Events.Debug: - { - WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - __processRecordId = System.Guid.NewGuid().ToString(); - try - { - // work - if (ShouldProcess($"Call remote 'PoliciesUpdate' operation")) - { - if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) - { - var instance = this.Clone(); - var job = new Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Token) ) - { - asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); - if (null != HttpPipelinePrepend) - { - Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); - } - if (null != HttpPipelineAppend) - { - Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); - } - // get the client instance - try - { - await ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.PoliciesUpdateViaJsonString(SubscriptionId, ResourceGroupName, NamespaceName, Name, _jsonString, onOk, onDefault, this, Pipeline); - await ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - } - catch (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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,NamespaceName=NamespaceName,Name=Name}) - { - ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } - }); - } - finally - { - await ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletProcessRecordAsyncEnd); - } - } - } - - /// Interrupts currently running code within the command. - protected override void StopProcessing() - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Cancel(); - base.StopProcessing(); - } - - /// - /// Initializes a new instance of the cmdlet class. - /// - public UpdateAzDeviceRegistryPolicy_UpdateViaJsonFilePath() - { - - } - - /// - new protected void WriteObject(object sendToPipeline) - { - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); - base.WriteObject(sendToPipeline); - } - - /// - /// - new protected void WriteObject(object sendToPipeline, bool enumerateCollection) - { - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.Models.IPolicy - /// 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.DeviceRegistry.Models.IPolicy - var result = (await response); - WriteObject(result, false); - } - } - } -} \ No newline at end of file diff --git a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/UpdateAzDeviceRegistryPolicy_UpdateViaJsonString.cs b/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/UpdateAzDeviceRegistryPolicy_UpdateViaJsonString.cs deleted file mode 100644 index 3ccb360a1665..000000000000 --- a/generated/DeviceRegistry/DeviceRegistry.Autorest/generated/cmdlets/UpdateAzDeviceRegistryPolicy_UpdateViaJsonString.cs +++ /dev/null @@ -1,589 +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.DeviceRegistry.Cmdlets -{ - using static Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Extensions; - using Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.PowerShell; - using Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Cmdlets; - using System; - - /// update a Policy - /// - /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/credentials/default/policies/{policyName}" - /// - [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzDeviceRegistryPolicy_UpdateViaJsonString", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IPolicy))] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Description(@"update a Policy")] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/credentials/default/policies/{policyName}", ApiVersion = "2025-11-01-preview")] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.NotSuggestDefaultParameterSet] - public partial class UpdateAzDeviceRegistryPolicy_UpdateViaJsonString : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener, - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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(); - - /// 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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.DeviceRegistry Client => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.ParameterCategory.Runtime)] - public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.ParameterCategory.Runtime)] - public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } - - /// Accessor for our copy of the InvocationInfo. - public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } - - /// Backing field for property. - private string _jsonString; - - /// Json string supplied to the Update operation - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Json string supplied to the Update operation")] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"Json string supplied to the Update operation", - SerializedName = @"JsonString", - PossibleTypes = new [] { typeof(string) })] - public string JsonString { get => this._jsonString; set => this._jsonString = value; } - - /// - /// cancellation delegate. Stops the cmdlet when called. - /// - global::System.Action Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; - - /// cancellation token. - global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener.Token => _cancellationTokenSource.Token; - - /// Backing field for property. - private string _name; - - /// The name of the Policy tracked resource. - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the Policy tracked resource.")] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The name of the Policy tracked resource.", - SerializedName = @"policyName", - PossibleTypes = new [] { typeof(string) })] - [global::System.Management.Automation.Alias("PolicyName")] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.ParameterCategory.Path)] - public string Name { get => this._name; set => this._name = value; } - - /// Backing field for property. - private string _namespaceName; - - /// The name of the namespace. - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the namespace.")] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The name of the namespace.", - SerializedName = @"namespaceName", - PossibleTypes = new [] { typeof(string) })] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.ParameterCategory.Path)] - public string NamespaceName { get => this._namespaceName; set => this._namespaceName = value; } - - /// - /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue - /// asynchronously. - /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The name of the resource group. The name is case insensitive.", - SerializedName = @"resourceGroupName", - PossibleTypes = new [] { typeof(string) })] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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. The value must be an UUID. - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription. The value must be an UUID.")] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The ID of the target subscription. The value must be an UUID.", - SerializedName = @"subscriptionId", - PossibleTypes = new [] { typeof(string) })] - [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.DefaultInfo( - Name = @"", - Description =@"", - Script = @"(Get-AzContext).Subscription.Id", - SetCondition = @"")] - [global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.Models.IPolicy - /// 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.DeviceRegistry.Module.Instance.GetTelemetryId.Invoke(); - if (telemetryId != "" && telemetryId != "internal") - { - __correlationId = telemetryId; - } - Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); - if (Break) - { - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.AttachDebugger.Break(); - } - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - } - - /// Creates a duplicate instance of this cmdlet (via JSON serialization). - /// a duplicate instance of UpdateAzDeviceRegistryPolicy_UpdateViaJsonString - public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Cmdlets.UpdateAzDeviceRegistryPolicy_UpdateViaJsonString Clone() - { - var clone = new UpdateAzDeviceRegistryPolicy_UpdateViaJsonString(); - 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.NamespaceName = this.NamespaceName; - clone.Name = this.Name; - clone.JsonString = this.JsonString; - return clone; - } - - /// Performs clean-up after the command execution - protected override void EndProcessing() - { - var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.Runtime.Events.Verbose: - { - WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.Warning: - { - WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.Events.Debug: - { - WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - __processRecordId = System.Guid.NewGuid().ToString(); - try - { - // work - if (ShouldProcess($"Call remote 'PoliciesUpdate' operation")) - { - if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) - { - var instance = this.Clone(); - var job = new Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Token) ) - { - asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); - if (null != HttpPipelinePrepend) - { - Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); - } - if (null != HttpPipelineAppend) - { - Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); - } - // get the client instance - try - { - await ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.PoliciesUpdateViaJsonString(SubscriptionId, ResourceGroupName, NamespaceName, Name, _jsonString, onOk, onDefault, this, Pipeline); - await ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - } - catch (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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,NamespaceName=NamespaceName,Name=Name}) - { - ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } - }); - } - finally - { - await ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Events.CmdletProcessRecordAsyncEnd); - } - } - } - - /// Interrupts currently running code within the command. - protected override void StopProcessing() - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IEventListener)this).Cancel(); - base.StopProcessing(); - } - - /// - /// Initializes a new instance of the cmdlet class. - /// - public UpdateAzDeviceRegistryPolicy_UpdateViaJsonString() - { - - } - - /// - new protected void WriteObject(object sendToPipeline) - { - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); - base.WriteObject(sendToPipeline); - } - - /// - /// - new protected void WriteObject(object sendToPipeline, bool enumerateCollection) - { - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.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.DeviceRegistry.Models.IPolicy - /// 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.DeviceRegistry.Models.IPolicy - var result = (await response); - WriteObject(result, false); - } - } - } -} \ No newline at end of file