diff --git a/src/Resources/Authorization.Autorest/Az.Authorization.psd1 b/src/Resources/Authorization.Autorest/Az.Authorization.psd1 index c8dcfdb2b34b..3daae3d24097 100644 --- a/src/Resources/Authorization.Autorest/Az.Authorization.psd1 +++ b/src/Resources/Authorization.Autorest/Az.Authorization.psd1 @@ -1,5 +1,5 @@ @{ - GUID = 'ef9a8a67-ab5b-4d21-a3ff-15127e64527d' + GUID = '90ee7f74-51af-4e60-ae68-70c82d6f9606' RootModule = './Az.Authorization.psm1' ModuleVersion = '0.1.0' CompatiblePSEditions = 'Core', 'Desktop' diff --git a/src/Resources/Authorization.Autorest/README.md b/src/Resources/Authorization.Autorest/README.md index 60f873cc9ae3..b72a6527a17f 100644 --- a/src/Resources/Authorization.Autorest/README.md +++ b/src/Resources/Authorization.Autorest/README.md @@ -30,21 +30,22 @@ For information on how to develop for `Az.Authorization`, see [how-to.md](how-to > see https://aka.ms/autorest ``` yaml +commit: 0023223a23b7a8c1693f7d88678787e50fee6c96 require: - $(this-folder)/../../readme.azure.noprofile.md input-file: - - https://github.com/Azure/azure-rest-api-specs/blob/0023223a23b7a8c1693f7d88678787e50fee6c96/specification/authorization/resource-manager/Microsoft.Authorization/preview/2020-10-01-preview/EligibleChildResources.json + - $(repo)/specification/authorization/resource-manager/Microsoft.Authorization/preview/2020-10-01-preview/EligibleChildResources.json - - https://github.com/Azure/azure-rest-api-specs/blob/0023223a23b7a8c1693f7d88678787e50fee6c96/specification/authorization/resource-manager/Microsoft.Authorization/preview/2020-10-01-preview/RoleAssignmentSchedule.json - - https://github.com/Azure/azure-rest-api-specs/blob/0023223a23b7a8c1693f7d88678787e50fee6c96/specification/authorization/resource-manager/Microsoft.Authorization/preview/2020-10-01-preview/RoleAssignmentScheduleInstance.json - - https://github.com/Azure/azure-rest-api-specs/blob/0023223a23b7a8c1693f7d88678787e50fee6c96/specification/authorization/resource-manager/Microsoft.Authorization/preview/2020-10-01-preview/RoleAssignmentScheduleRequest.json + - $(repo)/specification/authorization/resource-manager/Microsoft.Authorization/preview/2020-10-01-preview/RoleAssignmentSchedule.json + - $(repo)/specification/authorization/resource-manager/Microsoft.Authorization/preview/2020-10-01-preview/RoleAssignmentScheduleInstance.json + - $(repo)/specification/authorization/resource-manager/Microsoft.Authorization/preview/2020-10-01-preview/RoleAssignmentScheduleRequest.json - - https://github.com/Azure/azure-rest-api-specs/blob/0023223a23b7a8c1693f7d88678787e50fee6c96/specification/authorization/resource-manager/Microsoft.Authorization/preview/2020-10-01-preview/RoleEligibilitySchedule.json - - https://github.com/Azure/azure-rest-api-specs/blob/0023223a23b7a8c1693f7d88678787e50fee6c96/specification/authorization/resource-manager/Microsoft.Authorization/preview/2020-10-01-preview/RoleEligibilityScheduleInstance.json - - https://github.com/Azure/azure-rest-api-specs/blob/0023223a23b7a8c1693f7d88678787e50fee6c96/specification/authorization/resource-manager/Microsoft.Authorization/preview/2020-10-01-preview/RoleEligibilityScheduleRequest.json + - $(repo)/specification/authorization/resource-manager/Microsoft.Authorization/preview/2020-10-01-preview/RoleEligibilitySchedule.json + - $(repo)/specification/authorization/resource-manager/Microsoft.Authorization/preview/2020-10-01-preview/RoleEligibilityScheduleInstance.json + - $(repo)/specification/authorization/resource-manager/Microsoft.Authorization/preview/2020-10-01-preview/RoleEligibilityScheduleRequest.json - - https://github.com/Azure/azure-rest-api-specs/blob/0023223a23b7a8c1693f7d88678787e50fee6c96/specification/authorization/resource-manager/Microsoft.Authorization/preview/2020-10-01-preview/RoleManagementPolicy.json - - https://github.com/Azure/azure-rest-api-specs/blob/23800927d61999e655f6fd7fd054deaa80385683/specification/authorization/resource-manager/Microsoft.Authorization/preview/2020-10-01-preview/RoleManagementPolicyAssignment.json + - $(repo)/specification/authorization/resource-manager/Microsoft.Authorization/preview/2020-10-01-preview/RoleManagementPolicy.json + - $(repo)/specification/authorization/resource-manager/Microsoft.Authorization/preview/2020-10-01-preview/RoleManagementPolicyAssignment.json root-module-name: $(prefix).Resources title: Authorization @@ -55,6 +56,10 @@ identity-correction-for-post: true resourcegroup-append: true default-exclude-tableview-properties: false +# For new modules, please avoid setting 3.x using the use-extension method and instead, use 4.x as the default option +use-extension: + "@autorest/powershell": "3.x" + directive: # Swaager bug: The scope should be readonly according to the server response. - from: swagger-document diff --git a/src/Resources/Authorization.Autorest/UX/Microsoft.Authorization/roleAssignmentScheduleInstances.json b/src/Resources/Authorization.Autorest/UX/Microsoft.Authorization/roleAssignmentScheduleInstances.json new file mode 100644 index 000000000000..f9d4058433ad --- /dev/null +++ b/src/Resources/Authorization.Autorest/UX/Microsoft.Authorization/roleAssignmentScheduleInstances.json @@ -0,0 +1,42 @@ +{ + "resourceType": "roleAssignmentScheduleInstances", + "apiVersion": "2020-10-01-preview", + "learnMore": { + "url": "https://learn.microsoft.com/powershell/module/az.resources" + }, + "commands": [ + { + "name": "Get-AzRoleAssignmentScheduleInstance", + "description": "Gets the specified role assignment schedule instance.", + "path": "/{scope}/providers/Microsoft.Authorization/roleAssignmentScheduleInstances/{roleAssignmentScheduleInstanceName}", + "help": { + "learnMore": { + "url": "https://learn.microsoft.com/powershell/module/az.resources/get-azroleassignmentscheduleinstance" + }, + "parameterSets": [ + { + "parameters": [ + "-Name ", + "-Scope " + ] + } + ] + }, + "examples": [ + { + "description": "Gets the specified role assignment schedule instance.", + "parameters": [ + { + "name": "-Name", + "value": "[Path.roleAssignmentScheduleInstanceName]" + }, + { + "name": "-Scope", + "value": "[Path.scope]" + } + ] + } + ] + } + ] +} diff --git a/src/Resources/Authorization.Autorest/UX/Microsoft.Authorization/roleAssignmentScheduleRequests.json b/src/Resources/Authorization.Autorest/UX/Microsoft.Authorization/roleAssignmentScheduleRequests.json new file mode 100644 index 000000000000..602fc4fde732 --- /dev/null +++ b/src/Resources/Authorization.Autorest/UX/Microsoft.Authorization/roleAssignmentScheduleRequests.json @@ -0,0 +1,75 @@ +{ + "resourceType": "roleAssignmentScheduleRequests", + "apiVersion": "2020-10-01-preview", + "learnMore": { + "url": "https://learn.microsoft.com/powershell/module/az.resources" + }, + "commands": [ + { + "name": "Get-AzRoleAssignmentScheduleRequest", + "description": "Get the specified role assignment schedule request.", + "path": "/{scope}/providers/Microsoft.Authorization/roleAssignmentScheduleRequests/{roleAssignmentScheduleRequestName}", + "help": { + "learnMore": { + "url": "https://learn.microsoft.com/powershell/module/az.resources/get-azroleassignmentschedulerequest" + }, + "parameterSets": [ + { + "parameters": [ + "-Name ", + "-Scope " + ] + } + ] + }, + "examples": [ + { + "description": "Get the specified role assignment schedule request.", + "parameters": [ + { + "name": "-Name", + "value": "[Path.roleAssignmentScheduleRequestName]" + }, + { + "name": "-Scope", + "value": "[Path.scope]" + } + ] + } + ] + }, + { + "name": "Stop-AzRoleAssignmentScheduleRequest", + "description": "Cancels a pending role assignment schedule request.", + "path": "/{scope}/providers/Microsoft.Authorization/roleAssignmentScheduleRequests/{roleAssignmentScheduleRequestName}/cancel", + "help": { + "learnMore": { + "url": "https://learn.microsoft.com/powershell/module/az.resources/stop-azroleassignmentschedulerequest" + }, + "parameterSets": [ + { + "parameters": [ + "-Name ", + "-Scope " + ] + } + ] + }, + "examples": [ + { + "description": "Cancels a pending role assignment schedule request.", + "parameters": [ + { + "name": "-Name", + "value": "[Path.roleAssignmentScheduleRequestName]" + }, + { + "name": "-Scope", + "value": "[Path.scope]" + } + ] + } + ] + } + ] +} diff --git a/src/Resources/Authorization.Autorest/UX/Microsoft.Authorization/roleAssignmentSchedules.json b/src/Resources/Authorization.Autorest/UX/Microsoft.Authorization/roleAssignmentSchedules.json new file mode 100644 index 000000000000..8a7cf7890e76 --- /dev/null +++ b/src/Resources/Authorization.Autorest/UX/Microsoft.Authorization/roleAssignmentSchedules.json @@ -0,0 +1,42 @@ +{ + "resourceType": "roleAssignmentSchedules", + "apiVersion": "2020-10-01-preview", + "learnMore": { + "url": "https://learn.microsoft.com/powershell/module/az.resources" + }, + "commands": [ + { + "name": "Get-AzRoleAssignmentSchedule", + "description": "Get the specified role assignment schedule for a resource scope", + "path": "/{scope}/providers/Microsoft.Authorization/roleAssignmentSchedules/{roleAssignmentScheduleName}", + "help": { + "learnMore": { + "url": "https://learn.microsoft.com/powershell/module/az.resources/get-azroleassignmentschedule" + }, + "parameterSets": [ + { + "parameters": [ + "-Name ", + "-Scope " + ] + } + ] + }, + "examples": [ + { + "description": "Get the specified role assignment schedule for a resource scope", + "parameters": [ + { + "name": "-Name", + "value": "[Path.roleAssignmentScheduleName]" + }, + { + "name": "-Scope", + "value": "[Path.scope]" + } + ] + } + ] + } + ] +} diff --git a/src/Resources/Authorization.Autorest/UX/Microsoft.Authorization/roleEligibilityScheduleInstances.json b/src/Resources/Authorization.Autorest/UX/Microsoft.Authorization/roleEligibilityScheduleInstances.json new file mode 100644 index 000000000000..1bb20965b9a3 --- /dev/null +++ b/src/Resources/Authorization.Autorest/UX/Microsoft.Authorization/roleEligibilityScheduleInstances.json @@ -0,0 +1,42 @@ +{ + "resourceType": "roleEligibilityScheduleInstances", + "apiVersion": "2020-10-01-preview", + "learnMore": { + "url": "https://learn.microsoft.com/powershell/module/az.resources" + }, + "commands": [ + { + "name": "Get-AzRoleEligibilityScheduleInstance", + "description": "Gets the specified role eligibility schedule instance.", + "path": "/{scope}/providers/Microsoft.Authorization/roleEligibilityScheduleInstances/{roleEligibilityScheduleInstanceName}", + "help": { + "learnMore": { + "url": "https://learn.microsoft.com/powershell/module/az.resources/get-azroleeligibilityscheduleinstance" + }, + "parameterSets": [ + { + "parameters": [ + "-Name ", + "-Scope " + ] + } + ] + }, + "examples": [ + { + "description": "Gets the specified role eligibility schedule instance.", + "parameters": [ + { + "name": "-Name", + "value": "[Path.roleEligibilityScheduleInstanceName]" + }, + { + "name": "-Scope", + "value": "[Path.scope]" + } + ] + } + ] + } + ] +} diff --git a/src/Resources/Authorization.Autorest/UX/Microsoft.Authorization/roleEligibilityScheduleRequests.json b/src/Resources/Authorization.Autorest/UX/Microsoft.Authorization/roleEligibilityScheduleRequests.json new file mode 100644 index 000000000000..ee6cfd7f55ac --- /dev/null +++ b/src/Resources/Authorization.Autorest/UX/Microsoft.Authorization/roleEligibilityScheduleRequests.json @@ -0,0 +1,75 @@ +{ + "resourceType": "roleEligibilityScheduleRequests", + "apiVersion": "2020-10-01-preview", + "learnMore": { + "url": "https://learn.microsoft.com/powershell/module/az.resources" + }, + "commands": [ + { + "name": "Get-AzRoleEligibilityScheduleRequest", + "description": "Get the specified role eligibility schedule request.", + "path": "/{scope}/providers/Microsoft.Authorization/roleEligibilityScheduleRequests/{roleEligibilityScheduleRequestName}", + "help": { + "learnMore": { + "url": "https://learn.microsoft.com/powershell/module/az.resources/get-azroleeligibilityschedulerequest" + }, + "parameterSets": [ + { + "parameters": [ + "-Name ", + "-Scope " + ] + } + ] + }, + "examples": [ + { + "description": "Get the specified role eligibility schedule request.", + "parameters": [ + { + "name": "-Name", + "value": "[Path.roleEligibilityScheduleRequestName]" + }, + { + "name": "-Scope", + "value": "[Path.scope]" + } + ] + } + ] + }, + { + "name": "Stop-AzRoleEligibilityScheduleRequest", + "description": "Cancels a pending role eligibility schedule request.", + "path": "/{scope}/providers/Microsoft.Authorization/roleEligibilityScheduleRequests/{roleEligibilityScheduleRequestName}/cancel", + "help": { + "learnMore": { + "url": "https://learn.microsoft.com/powershell/module/az.resources/stop-azroleeligibilityschedulerequest" + }, + "parameterSets": [ + { + "parameters": [ + "-Name ", + "-Scope " + ] + } + ] + }, + "examples": [ + { + "description": "Cancels a pending role eligibility schedule request.", + "parameters": [ + { + "name": "-Name", + "value": "[Path.roleEligibilityScheduleRequestName]" + }, + { + "name": "-Scope", + "value": "[Path.scope]" + } + ] + } + ] + } + ] +} diff --git a/src/Resources/Authorization.Autorest/UX/Microsoft.Authorization/roleEligibilitySchedules.json b/src/Resources/Authorization.Autorest/UX/Microsoft.Authorization/roleEligibilitySchedules.json new file mode 100644 index 000000000000..1e7c900a6b97 --- /dev/null +++ b/src/Resources/Authorization.Autorest/UX/Microsoft.Authorization/roleEligibilitySchedules.json @@ -0,0 +1,42 @@ +{ + "resourceType": "roleEligibilitySchedules", + "apiVersion": "2020-10-01-preview", + "learnMore": { + "url": "https://learn.microsoft.com/powershell/module/az.resources" + }, + "commands": [ + { + "name": "Get-AzRoleEligibilitySchedule", + "description": "Get the specified role eligibility schedule for a resource scope", + "path": "/{scope}/providers/Microsoft.Authorization/roleEligibilitySchedules/{roleEligibilityScheduleName}", + "help": { + "learnMore": { + "url": "https://learn.microsoft.com/powershell/module/az.resources/get-azroleeligibilityschedule" + }, + "parameterSets": [ + { + "parameters": [ + "-Name ", + "-Scope " + ] + } + ] + }, + "examples": [ + { + "description": "Get the specified role eligibility schedule for a resource scope", + "parameters": [ + { + "name": "-Name", + "value": "[Path.roleEligibilityScheduleName]" + }, + { + "name": "-Scope", + "value": "[Path.scope]" + } + ] + } + ] + } + ] +} diff --git a/src/Resources/Authorization.Autorest/UX/Microsoft.Authorization/roleManagementPolicies.json b/src/Resources/Authorization.Autorest/UX/Microsoft.Authorization/roleManagementPolicies.json new file mode 100644 index 000000000000..b88f43155d01 --- /dev/null +++ b/src/Resources/Authorization.Autorest/UX/Microsoft.Authorization/roleManagementPolicies.json @@ -0,0 +1,75 @@ +{ + "resourceType": "roleManagementPolicies", + "apiVersion": "2020-10-01-preview", + "learnMore": { + "url": "https://learn.microsoft.com/powershell/module/az.resources" + }, + "commands": [ + { + "name": "Get-AzRoleManagementPolicy", + "description": "Get the specified role management policy for a resource scope", + "path": "/{scope}/providers/Microsoft.Authorization/roleManagementPolicies/{roleManagementPolicyName}", + "help": { + "learnMore": { + "url": "https://learn.microsoft.com/powershell/module/az.resources/get-azrolemanagementpolicy" + }, + "parameterSets": [ + { + "parameters": [ + "-Name ", + "-Scope " + ] + } + ] + }, + "examples": [ + { + "description": "Get the specified role management policy for a resource scope", + "parameters": [ + { + "name": "-Name", + "value": "[Path.roleManagementPolicyName]" + }, + { + "name": "-Scope", + "value": "[Path.scope]" + } + ] + } + ] + }, + { + "name": "Remove-AzRoleManagementPolicy", + "description": "Delete a role management policy", + "path": "/{scope}/providers/Microsoft.Authorization/roleManagementPolicies/{roleManagementPolicyName}", + "help": { + "learnMore": { + "url": "https://learn.microsoft.com/powershell/module/az.resources/remove-azrolemanagementpolicy" + }, + "parameterSets": [ + { + "parameters": [ + "-Name ", + "-Scope " + ] + } + ] + }, + "examples": [ + { + "description": "Delete a role management policy", + "parameters": [ + { + "name": "-Name", + "value": "[Path.roleManagementPolicyName]" + }, + { + "name": "-Scope", + "value": "[Path.scope]" + } + ] + } + ] + } + ] +} diff --git a/src/Resources/Authorization.Autorest/UX/Microsoft.Authorization/roleManagementPolicyAssignments.json b/src/Resources/Authorization.Autorest/UX/Microsoft.Authorization/roleManagementPolicyAssignments.json new file mode 100644 index 000000000000..951b0e736ea3 --- /dev/null +++ b/src/Resources/Authorization.Autorest/UX/Microsoft.Authorization/roleManagementPolicyAssignments.json @@ -0,0 +1,75 @@ +{ + "resourceType": "roleManagementPolicyAssignments", + "apiVersion": "2020-10-01-preview", + "learnMore": { + "url": "https://learn.microsoft.com/powershell/module/az.resources" + }, + "commands": [ + { + "name": "Get-AzRoleManagementPolicyAssignment", + "description": "Get the specified role management policy assignment for a resource scope", + "path": "/{scope}/providers/Microsoft.Authorization/roleManagementPolicyAssignments/{roleManagementPolicyAssignmentName}", + "help": { + "learnMore": { + "url": "https://learn.microsoft.com/powershell/module/az.resources/get-azrolemanagementpolicyassignment" + }, + "parameterSets": [ + { + "parameters": [ + "-Name ", + "-Scope " + ] + } + ] + }, + "examples": [ + { + "description": "Get the specified role management policy assignment for a resource scope", + "parameters": [ + { + "name": "-Name", + "value": "[Path.roleManagementPolicyAssignmentName]" + }, + { + "name": "-Scope", + "value": "[Path.scope]" + } + ] + } + ] + }, + { + "name": "Remove-AzRoleManagementPolicyAssignment", + "description": "Delete a role management policy assignment", + "path": "/{scope}/providers/Microsoft.Authorization/roleManagementPolicyAssignments/{roleManagementPolicyAssignmentName}", + "help": { + "learnMore": { + "url": "https://learn.microsoft.com/powershell/module/az.resources/remove-azrolemanagementpolicyassignment" + }, + "parameterSets": [ + { + "parameters": [ + "-Name ", + "-Scope " + ] + } + ] + }, + "examples": [ + { + "description": "Delete a role management policy assignment", + "parameters": [ + { + "name": "-Name", + "value": "[Path.roleManagementPolicyAssignmentName]" + }, + { + "name": "-Scope", + "value": "[Path.scope]" + } + ] + } + ] + } + ] +} diff --git a/src/Resources/Authorization.Autorest/build-module.ps1 b/src/Resources/Authorization.Autorest/build-module.ps1 index ab0d767a722a..82ffeed4ec35 100644 --- a/src/Resources/Authorization.Autorest/build-module.ps1 +++ b/src/Resources/Authorization.Autorest/build-module.ps1 @@ -143,7 +143,8 @@ if($NoDocs) { $null = Get-ChildItem -Path $docsFolder -Recurse -Exclude 'README.md' | Remove-Item -Recurse -ErrorAction SilentlyContinue } $null = New-Item -ItemType Directory -Force -Path $docsFolder - Export-ProxyCmdlet -ModuleName $moduleName -ModulePath $modulePaths -ExportsFolder $exportsFolder -InternalFolder $internalFolder -ModuleDescription $moduleDescription -DocsFolder $docsFolder -ExamplesFolder $examplesFolder -ModuleGuid $guid + $addComplexInterfaceInfo = ![System.Convert]::ToBoolean('true') + Export-ProxyCmdlet -ModuleName $moduleName -ModulePath $modulePaths -ExportsFolder $exportsFolder -InternalFolder $internalFolder -ModuleDescription $moduleDescription -DocsFolder $docsFolder -ExamplesFolder $examplesFolder -ModuleGuid $guid -AddComplexInterfaceInfo:$addComplexInterfaceInfo } Write-Host -ForegroundColor Green 'Creating format.ps1xml...' @@ -162,4 +163,10 @@ Export-TestStub -ModuleName $moduleName -ExportsFolder $exportsFolder -OutputFol Write-Host -ForegroundColor Green 'Creating example stubs...' Export-ExampleStub -ExportsFolder $exportsFolder -OutputFolder $examplesFolder +if (Test-Path (Join-Path $PSScriptRoot 'generate-portal-ux.ps1')) +{ + Write-Host -ForegroundColor Green 'Creating ux metadata...' + . (Join-Path $PSScriptRoot 'generate-portal-ux.ps1') +} + Write-Host -ForegroundColor Green '-------------Done-------------' diff --git a/src/Resources/Authorization.Autorest/exports/Get-AzRoleAssignmentSchedule.ps1 b/src/Resources/Authorization.Autorest/exports/Get-AzRoleAssignmentSchedule.ps1 index e50b6bf6c94f..2fe3f1345674 100644 --- a/src/Resources/Authorization.Autorest/exports/Get-AzRoleAssignmentSchedule.ps1 +++ b/src/Resources/Authorization.Autorest/exports/Get-AzRoleAssignmentSchedule.ps1 @@ -172,6 +172,10 @@ begin { } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) diff --git a/src/Resources/Authorization.Autorest/exports/Get-AzRoleAssignmentScheduleInstance.ps1 b/src/Resources/Authorization.Autorest/exports/Get-AzRoleAssignmentScheduleInstance.ps1 index 5e9d7011ce09..14993662673e 100644 --- a/src/Resources/Authorization.Autorest/exports/Get-AzRoleAssignmentScheduleInstance.ps1 +++ b/src/Resources/Authorization.Autorest/exports/Get-AzRoleAssignmentScheduleInstance.ps1 @@ -172,6 +172,10 @@ begin { } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) diff --git a/src/Resources/Authorization.Autorest/exports/Get-AzRoleAssignmentScheduleRequest.ps1 b/src/Resources/Authorization.Autorest/exports/Get-AzRoleAssignmentScheduleRequest.ps1 index e830ff568c8c..175e0ae89b6f 100644 --- a/src/Resources/Authorization.Autorest/exports/Get-AzRoleAssignmentScheduleRequest.ps1 +++ b/src/Resources/Authorization.Autorest/exports/Get-AzRoleAssignmentScheduleRequest.ps1 @@ -172,6 +172,10 @@ begin { } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) diff --git a/src/Resources/Authorization.Autorest/exports/Get-AzRoleEligibilitySchedule.ps1 b/src/Resources/Authorization.Autorest/exports/Get-AzRoleEligibilitySchedule.ps1 index ddfecb3f67f6..4391f3e0cd9d 100644 --- a/src/Resources/Authorization.Autorest/exports/Get-AzRoleEligibilitySchedule.ps1 +++ b/src/Resources/Authorization.Autorest/exports/Get-AzRoleEligibilitySchedule.ps1 @@ -172,6 +172,10 @@ begin { } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) diff --git a/src/Resources/Authorization.Autorest/exports/Get-AzRoleEligibilityScheduleInstance.ps1 b/src/Resources/Authorization.Autorest/exports/Get-AzRoleEligibilityScheduleInstance.ps1 index a51705c695d1..ff6e6ef71529 100644 --- a/src/Resources/Authorization.Autorest/exports/Get-AzRoleEligibilityScheduleInstance.ps1 +++ b/src/Resources/Authorization.Autorest/exports/Get-AzRoleEligibilityScheduleInstance.ps1 @@ -172,6 +172,10 @@ begin { } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) diff --git a/src/Resources/Authorization.Autorest/exports/Get-AzRoleEligibilityScheduleRequest.ps1 b/src/Resources/Authorization.Autorest/exports/Get-AzRoleEligibilityScheduleRequest.ps1 index 6b45e571b08f..1e7f581bdaa7 100644 --- a/src/Resources/Authorization.Autorest/exports/Get-AzRoleEligibilityScheduleRequest.ps1 +++ b/src/Resources/Authorization.Autorest/exports/Get-AzRoleEligibilityScheduleRequest.ps1 @@ -172,6 +172,10 @@ begin { } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) diff --git a/src/Resources/Authorization.Autorest/exports/Get-AzRoleEligibleChildResource.ps1 b/src/Resources/Authorization.Autorest/exports/Get-AzRoleEligibleChildResource.ps1 index a99661f79afb..e3031b7d831c 100644 --- a/src/Resources/Authorization.Autorest/exports/Get-AzRoleEligibleChildResource.ps1 +++ b/src/Resources/Authorization.Autorest/exports/Get-AzRoleEligibleChildResource.ps1 @@ -155,6 +155,10 @@ begin { } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) diff --git a/src/Resources/Authorization.Autorest/exports/Get-AzRoleManagementPolicy.ps1 b/src/Resources/Authorization.Autorest/exports/Get-AzRoleManagementPolicy.ps1 index 04cc1c8e246f..e77bd6af2fef 100644 --- a/src/Resources/Authorization.Autorest/exports/Get-AzRoleManagementPolicy.ps1 +++ b/src/Resources/Authorization.Autorest/exports/Get-AzRoleManagementPolicy.ps1 @@ -156,6 +156,10 @@ begin { } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) diff --git a/src/Resources/Authorization.Autorest/exports/Get-AzRoleManagementPolicyAssignment.ps1 b/src/Resources/Authorization.Autorest/exports/Get-AzRoleManagementPolicyAssignment.ps1 index 77f580fbe0be..9a93332d5a09 100644 --- a/src/Resources/Authorization.Autorest/exports/Get-AzRoleManagementPolicyAssignment.ps1 +++ b/src/Resources/Authorization.Autorest/exports/Get-AzRoleManagementPolicyAssignment.ps1 @@ -156,6 +156,10 @@ begin { } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) diff --git a/src/Resources/Authorization.Autorest/exports/New-AzRoleAssignmentScheduleRequest.ps1 b/src/Resources/Authorization.Autorest/exports/New-AzRoleAssignmentScheduleRequest.ps1 index cd675194d7b6..16ba2a9504ac 100644 --- a/src/Resources/Authorization.Autorest/exports/New-AzRoleAssignmentScheduleRequest.ps1 +++ b/src/Resources/Authorization.Autorest/exports/New-AzRoleAssignmentScheduleRequest.ps1 @@ -240,6 +240,10 @@ begin { } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) diff --git a/src/Resources/Authorization.Autorest/exports/New-AzRoleEligibilityScheduleRequest.ps1 b/src/Resources/Authorization.Autorest/exports/New-AzRoleEligibilityScheduleRequest.ps1 index 1cb354bcd6a7..cf1964520554 100644 --- a/src/Resources/Authorization.Autorest/exports/New-AzRoleEligibilityScheduleRequest.ps1 +++ b/src/Resources/Authorization.Autorest/exports/New-AzRoleEligibilityScheduleRequest.ps1 @@ -224,6 +224,10 @@ begin { } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) diff --git a/src/Resources/Authorization.Autorest/exports/New-AzRoleManagementPolicyAssignment.ps1 b/src/Resources/Authorization.Autorest/exports/New-AzRoleManagementPolicyAssignment.ps1 index fbc6b1046685..4ec02b194e7f 100644 --- a/src/Resources/Authorization.Autorest/exports/New-AzRoleManagementPolicyAssignment.ps1 +++ b/src/Resources/Authorization.Autorest/exports/New-AzRoleManagementPolicyAssignment.ps1 @@ -136,6 +136,10 @@ begin { } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) diff --git a/src/Resources/Authorization.Autorest/exports/ProxyCmdletDefinitions.ps1 b/src/Resources/Authorization.Autorest/exports/ProxyCmdletDefinitions.ps1 index 4303d7a6df31..ffe051446715 100644 --- a/src/Resources/Authorization.Autorest/exports/ProxyCmdletDefinitions.ps1 +++ b/src/Resources/Authorization.Autorest/exports/ProxyCmdletDefinitions.ps1 @@ -172,6 +172,10 @@ begin { } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) @@ -374,6 +378,10 @@ begin { } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) @@ -576,6 +584,10 @@ begin { } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) @@ -778,6 +790,10 @@ begin { } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) @@ -980,6 +996,10 @@ begin { } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) @@ -1182,6 +1202,10 @@ begin { } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) @@ -1367,6 +1391,10 @@ begin { } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) @@ -1553,6 +1581,10 @@ begin { } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) @@ -1739,6 +1771,10 @@ begin { } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) @@ -2009,6 +2045,10 @@ begin { } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) @@ -2263,6 +2303,10 @@ begin { } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) @@ -2429,6 +2473,10 @@ begin { } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) @@ -2615,6 +2663,10 @@ begin { } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) @@ -2801,6 +2853,10 @@ begin { } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) @@ -2988,6 +3044,10 @@ begin { } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) @@ -3175,6 +3235,10 @@ begin { } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) @@ -3435,6 +3499,10 @@ begin { } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) diff --git a/src/Resources/Authorization.Autorest/exports/Remove-AzRoleManagementPolicy.ps1 b/src/Resources/Authorization.Autorest/exports/Remove-AzRoleManagementPolicy.ps1 index bad6ea890a65..6fc7995199d3 100644 --- a/src/Resources/Authorization.Autorest/exports/Remove-AzRoleManagementPolicy.ps1 +++ b/src/Resources/Authorization.Autorest/exports/Remove-AzRoleManagementPolicy.ps1 @@ -156,6 +156,10 @@ begin { } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) diff --git a/src/Resources/Authorization.Autorest/exports/Remove-AzRoleManagementPolicyAssignment.ps1 b/src/Resources/Authorization.Autorest/exports/Remove-AzRoleManagementPolicyAssignment.ps1 index af26d77453bb..d45eaa7b1505 100644 --- a/src/Resources/Authorization.Autorest/exports/Remove-AzRoleManagementPolicyAssignment.ps1 +++ b/src/Resources/Authorization.Autorest/exports/Remove-AzRoleManagementPolicyAssignment.ps1 @@ -156,6 +156,10 @@ begin { } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) diff --git a/src/Resources/Authorization.Autorest/exports/Stop-AzRoleAssignmentScheduleRequest.ps1 b/src/Resources/Authorization.Autorest/exports/Stop-AzRoleAssignmentScheduleRequest.ps1 index ea319f1e7409..d9f880ae00ce 100644 --- a/src/Resources/Authorization.Autorest/exports/Stop-AzRoleAssignmentScheduleRequest.ps1 +++ b/src/Resources/Authorization.Autorest/exports/Stop-AzRoleAssignmentScheduleRequest.ps1 @@ -157,6 +157,10 @@ begin { } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) diff --git a/src/Resources/Authorization.Autorest/exports/Stop-AzRoleEligibilityScheduleRequest.ps1 b/src/Resources/Authorization.Autorest/exports/Stop-AzRoleEligibilityScheduleRequest.ps1 index 8ad19bf3a891..4c044ab56360 100644 --- a/src/Resources/Authorization.Autorest/exports/Stop-AzRoleEligibilityScheduleRequest.ps1 +++ b/src/Resources/Authorization.Autorest/exports/Stop-AzRoleEligibilityScheduleRequest.ps1 @@ -157,6 +157,10 @@ begin { } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) diff --git a/src/Resources/Authorization.Autorest/exports/Update-AzRoleManagementPolicy.ps1 b/src/Resources/Authorization.Autorest/exports/Update-AzRoleManagementPolicy.ps1 index 87a844fb47b7..b601d45a19d6 100644 --- a/src/Resources/Authorization.Autorest/exports/Update-AzRoleManagementPolicy.ps1 +++ b/src/Resources/Authorization.Autorest/exports/Update-AzRoleManagementPolicy.ps1 @@ -230,6 +230,10 @@ begin { } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) diff --git a/src/Resources/Authorization.Autorest/generate-help.ps1 b/src/Resources/Authorization.Autorest/generate-help.ps1 index 684ad00ce7d6..b90b10d82057 100644 --- a/src/Resources/Authorization.Autorest/generate-help.ps1 +++ b/src/Resources/Authorization.Autorest/generate-help.ps1 @@ -66,8 +66,8 @@ foreach($directory in $directories) $docsPath = Join-Path $docsFolder $directory.Name $null = New-Item -ItemType Directory -Force -Path $docsPath -ErrorAction SilentlyContinue $examplesPath = Join-Path $examplesFolder $directory.Name - - Export-HelpMarkdown -ModuleInfo $moduleInfo -FunctionInfo $cmdletFunctionInfo -HelpInfo $cmdletHelpInfo -DocsFolder $docsPath -ExamplesFolder $examplesPath + $addComplexInterfaceInfo = ![System.Convert]::ToBoolean('true') + Export-HelpMarkdown -ModuleInfo $moduleInfo -FunctionInfo $cmdletFunctionInfo -HelpInfo $cmdletHelpInfo -DocsFolder $docsPath -ExamplesFolder $examplesPath -AddComplexInterfaceInfo:$addComplexInterfaceInfo Write-Host -ForegroundColor Green "Created documentation in '$docsPath'" } diff --git a/src/Resources/Authorization.Autorest/generate-portal-ux.ps1 b/src/Resources/Authorization.Autorest/generate-portal-ux.ps1 new file mode 100644 index 000000000000..cafe613593fe --- /dev/null +++ b/src/Resources/Authorization.Autorest/generate-portal-ux.ps1 @@ -0,0 +1,375 @@ +# ---------------------------------------------------------------------------------- +# 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. +# +# This Script will create a folder dedicated to Azure-specific content and includes metadata files essential for enhancing the user experience (UX) within the Azure portal. +# These files are utilized by the Azure portal to effectively present the usage of cmdlets related to specific resources on portal pages. +# ---------------------------------------------------------------------------------- +param([switch]$Isolated) +$ErrorActionPreference = 'Stop' + +$pwsh = [System.Diagnostics.Process]::GetCurrentProcess().Path +if(-not $Isolated) { + Write-Host -ForegroundColor Green 'Creating isolated process...' + & "$pwsh" -NonInteractive -NoLogo -NoProfile -File $MyInvocation.MyCommand.Path @PSBoundParameters -Isolated + return +} + +$moduleName = 'Az.Authorization' +$rootModuleName = 'Az.Resources' +if ($rootModuleName -eq "") +{ + $rootModuleName = $moduleName +} +$modulePsd1 = Get-Item -Path (Join-Path $PSScriptRoot "./$moduleName.psd1") +$modulePath = $modulePsd1.FullName + +# Load DLL to use build-time cmdlets +Import-Module -Name $modulePath +Import-Module -Name (Join-Path $PSScriptRoot "./bin/$moduleName.private.dll") +$instance = [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module]::Instance +# Module info is shared per profile +$moduleInfo = Get-Module -Name $moduleName +$parameterSetsInfo = Get-Module -Name "$moduleName.private" + +$buildinFunctions = @("Export-CmdletSurface", "Export-ExampleStub", "Export-FormatPs1xml", "Export-HelpMarkdown", "Export-ModelSurface", "Export-ProxyCmdlet", "Export-Psd1", "Export-TestStub", "Get-CommonParameter", "Get-ModuleGuid", "Get-ScriptCmdlet") + +function Test-FunctionSupported() +{ + [CmdletBinding()] + Param ( + [Parameter()] + [string] + $FunctionName + ) + + If ($buildinfunctions.Contains($FunctionName)) { + return $false + } + + $cmdletName, $parameterSetName = $FunctionName.Split("_") + If ($parameterSetName.Contains("List") -or $parameterSetName.Contains("ViaIdentity")) { + return $false + } + If ($cmdletName.StartsWith("New") -or $cmdletName.StartsWith("Set") -or $cmdletName.StartsWith("Update")) { + return $false + } + + $parameterSetInfo = $parameterSetsInfo.ExportedCmdlets[$FunctionName] + foreach ($parameterInfo in $parameterSetInfo.Parameters.Values) + { + $category = (Get-ParameterAttribute -ParameterInfo $parameterInfo -AttributeName "CategoryAttribute").Categories + $invalideCategory = @('Query', 'Body') + if ($invalideCategory -contains $category) + { + return $false + } + } + + $customFiles = Get-ChildItem -Path custom -Filter "$cmdletName.*" + if ($customFiles.Length -ne 0) + { + return $false + } + + return $true +} + +function Get-MappedCmdletFromFunctionName() +{ + [CmdletBinding()] + Param ( + [Parameter()] + [string] + $FunctionName + ) + + $cmdletName, $parameterSetName = $FunctionName.Split("_") + + return $cmdletName +} + +function Get-ParameterAttribute() +{ + [CmdletBinding()] + Param ( + [Parameter()] + [System.Management.Automation.ParameterMetadata] + $ParameterInfo, + [Parameter()] + [String] + $AttributeName + ) + return $ParameterInfo.Attributes | Where-Object { $_.TypeId.Name -eq $AttributeName } +} + +function Get-CmdletAttribute() +{ + [CmdletBinding()] + Param ( + [Parameter()] + [System.Management.Automation.CommandInfo] + $CmdletInfo, + [Parameter()] + [String] + $AttributeName + ) + + return $CmdletInfo.ImplementingType.GetTypeInfo().GetCustomAttributes([System.object], $true) | Where-Object { $_.TypeId.Name -eq $AttributeName } +} + +function Get-CmdletDescription() +{ + [CmdletBinding()] + Param ( + [Parameter()] + [String] + $CmdletName + ) + $helpInfo = Get-Help $CmdletName -Full + + $description = $helpInfo.Description.Text + if ($null -eq $description) + { + return "" + } + return $description +} + +# Test whether the parameter is from swagger http path +function Test-ParameterFromSwagger() +{ + [CmdletBinding()] + Param ( + [Parameter()] + [System.Management.Automation.ParameterMetadata] + $ParameterInfo + ) + $category = (Get-ParameterAttribute -ParameterInfo $ParameterInfo -AttributeName "CategoryAttribute").Categories + $doNotExport = Get-ParameterAttribute -ParameterInfo $ParameterInfo -AttributeName "DoNotExportAttribute" + if ($null -ne $doNotExport) + { + return $false + } + + $valideCategory = @('Path') + if ($valideCategory -contains $category) + { + return $true + } + return $false +} + +function New-ExampleForParameterSet() +{ + [CmdletBinding()] + Param ( + [Parameter()] + [System.Management.Automation.CommandInfo] + $ParameterSetInfo + ) + $parameters = $ParameterSetInfo.Parameters.Values | Where-Object { Test-ParameterFromSwagger $_ } + $result = @() + foreach ($parameter in $parameters) + { + $category = (Get-ParameterAttribute -parameterInfo $parameter -AttributeName "CategoryAttribute").Categories + $sourceName = (Get-ParameterAttribute -parameterInfo $parameter -AttributeName "InfoAttribute").SerializedName + $name = $parameter.Name + $result += [ordered]@{ + name = "-$Name" + value = "[$category.$sourceName]" + } + } + + return $result +} + +function New-ParameterArrayInParameterSet() +{ + [CmdletBinding()] + Param ( + [Parameter()] + [System.Management.Automation.CommandInfo] + $ParameterSetInfo + ) + $parameters = $ParameterSetInfo.Parameters.Values | Where-Object { Test-ParameterFromSwagger $_ } + $result = @() + foreach ($parameter in $parameters) + { + $isMandatory = (Get-ParameterAttribute -parameterInfo $parameter -AttributeName "ParameterAttribute").Mandatory + $parameterName = $parameter.Name + $parameterType = $parameter.ParameterType.ToString().Split('.')[1] + if ($parameter.SwitchParameter) + { + $parameterSignature = "-$parameterName" + } + else + { + $parameterSignature = "-$parameterName <$parameterType>" + } + if ($parameterName -eq "SubscriptionId") + { + $isMandatory = $false + } + if (-not $isMandatory) + { + $parameterSignature = "[$parameterSignature]" + } + $result += $parameterSignature + } + + return $result +} + +function New-MetadataForParameterSet() +{ + [CmdletBinding()] + Param ( + [Parameter()] + [System.Management.Automation.CommandInfo] + $ParameterSetInfo + ) + $httpAttribute = Get-CmdletAttribute -CmdletInfo $ParameterSetInfo -AttributeName "HttpPathAttribute" + $httpPath = $httpAttribute.Path + $apiVersion = $httpAttribute.ApiVersion + $provider = [System.Text.RegularExpressions.Regex]::New("/providers/([\w+\.]+)/").Match($httpPath).Groups[1].Value + $resourcePath = "/" + $httpPath.Split("$provider/")[1] + $resourceType = [System.Text.RegularExpressions.Regex]::New("/([\w]+)/\{\w+\}").Matches($resourcePath) | ForEach-Object {$_.groups[1].Value} | Join-String -Separator "/" + $cmdletName = Get-MappedCmdletFromFunctionName $ParameterSetInfo.Name + $description = (Get-CmdletAttribute -CmdletInfo $ParameterSetInfo -AttributeName "DescriptionAttribute").Description + [object[]]$example = New-ExampleForParameterSet $ParameterSetInfo + [string[]]$signature = New-ParameterArrayInParameterSet $ParameterSetInfo + + return @{ + Path = $httpPath + Provider = $provider + ResourceType = $resourceType + ApiVersion = $apiVersion + CmdletName = $cmdletName + Description = $description + Example = $example + Signature = @{ + parameters = $signature + } + } +} + +function Merge-WithExistCmdletMetadata() +{ + [CmdletBinding()] + Param ( + [Parameter()] + [System.Collections.Specialized.OrderedDictionary] + $ExistedCmdletInfo, + [Parameter()] + [Hashtable] + $ParameterSetMetadata + ) + $ExistedCmdletInfo.help.parameterSets += $ParameterSetMetadata.Signature + $ExistedCmdletInfo.examples += [ordered]@{ + description = $ParameterSetMetadata.Description + parameters = $ParameterSetMetadata.Example + } + + return $ExistedCmdletInfo +} + +function New-MetadataForCmdlet() +{ + [CmdletBinding()] + Param ( + [Parameter()] + [Hashtable] + $ParameterSetMetadata + ) + $cmdletName = $ParameterSetMetadata.CmdletName + $description = Get-CmdletDescription $cmdletName + $result = [ordered]@{ + name = $cmdletName + description = $description + path = $ParameterSetMetadata.Path + help = [ordered]@{ + learnMore = [ordered]@{ + url = "https://learn.microsoft.com/powershell/module/$rootModuleName/$cmdletName".ToLower() + } + parameterSets = @() + } + examples = @() + } + $result = Merge-WithExistCmdletMetadata -ExistedCmdletInfo $result -ParameterSetMetadata $ParameterSetMetadata + return $result +} + +$parameterSets = $parameterSetsInfo.ExportedCmdlets.Keys | Where-Object { Test-functionSupported($_) } +$resourceTypes = @{} +foreach ($parameterSetName in $parameterSets) +{ + $cmdletInfo = $parameterSetsInfo.ExportedCommands[$parameterSetName] + $parameterSetMetadata = New-MetadataForParameterSet -ParameterSetInfo $cmdletInfo + $cmdletName = $parameterSetMetadata.CmdletName + if (-not ($moduleInfo.ExportedCommands.ContainsKey($cmdletName))) + { + continue + } + if ($resourceTypes.ContainsKey($parameterSetMetadata.ResourceType)) + { + $ExistedCmdletInfo = $resourceTypes[$parameterSetMetadata.ResourceType].commands | Where-Object { $_.name -eq $cmdletName } + if ($ExistedCmdletInfo) + { + $ExistedCmdletInfo = Merge-WithExistCmdletMetadata -ExistedCmdletInfo $ExistedCmdletInfo -ParameterSetMetadata $parameterSetMetadata + } + else + { + $cmdletInfo = New-MetadataForCmdlet -ParameterSetMetadata $parameterSetMetadata + $resourceTypes[$parameterSetMetadata.ResourceType].commands += $cmdletInfo + } + } + else + { + $cmdletInfo = New-MetadataForCmdlet -ParameterSetMetadata $parameterSetMetadata + $resourceTypes[$parameterSetMetadata.ResourceType] = [ordered]@{ + resourceType = $parameterSetMetadata.ResourceType + apiVersion = $parameterSetMetadata.ApiVersion + learnMore = @{ + url = "https://learn.microsoft.com/powershell/module/$rootModuleName".ToLower() + } + commands = @($cmdletInfo) + provider = $parameterSetMetadata.Provider + } + } +} + +$UXFolder = 'UX' +if (Test-Path $UXFolder) +{ + Remove-Item -Path $UXFolder -Recurse +} +$null = New-Item -ItemType Directory -Path $UXFolder + +foreach ($resourceType in $resourceTypes.Keys) +{ + $resourceTypeFileName = $resourceType -replace "/", "-" + if ($resourceTypeFileName -eq "") + { + continue + } + $resourceTypeInfo = $resourceTypes[$resourceType] + $provider = $resourceTypeInfo.provider + $providerFolder = "$UXFolder/$provider" + if (-not (Test-Path $providerFolder)) + { + $null = New-Item -ItemType Directory -Path $providerFolder + } + $resourceTypeInfo.Remove("provider") + $resourceTypeInfo | ConvertTo-Json -Depth 10 | Out-File "$providerFolder/$resourceTypeFileName.json" +} \ No newline at end of file diff --git a/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleAssignmentScheduleInstance_Get.cs b/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleAssignmentScheduleInstance_Get.cs index 55e007ee7f02..812b9cefcfd6 100644 --- a/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleAssignmentScheduleInstance_Get.cs +++ b/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleAssignmentScheduleInstance_Get.cs @@ -16,6 +16,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstance))] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Description(@"Gets the specified role assignment schedule instance.")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.HttpPath(Path = "/{scope}/providers/Microsoft.Authorization/roleAssignmentScheduleInstances/{roleAssignmentScheduleInstanceName}", ApiVersion = "2020-10-01-preview")] public partial class GetAzRoleAssignmentScheduleInstance_Get : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener { diff --git a/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleAssignmentScheduleInstance_GetViaIdentity.cs b/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleAssignmentScheduleInstance_GetViaIdentity.cs index 96d85171d8ab..938c9ff8857a 100644 --- a/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleAssignmentScheduleInstance_GetViaIdentity.cs +++ b/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleAssignmentScheduleInstance_GetViaIdentity.cs @@ -16,6 +16,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstance))] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Description(@"Gets the specified role assignment schedule instance.")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.HttpPath(Path = "/{scope}/providers/Microsoft.Authorization/roleAssignmentScheduleInstances/{roleAssignmentScheduleInstanceName}", ApiVersion = "2020-10-01-preview")] public partial class GetAzRoleAssignmentScheduleInstance_GetViaIdentity : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener { diff --git a/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleAssignmentScheduleInstance_List.cs b/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleAssignmentScheduleInstance_List.cs index 2178d4995053..cc1cbd75e56b 100644 --- a/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleAssignmentScheduleInstance_List.cs +++ b/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleAssignmentScheduleInstance_List.cs @@ -16,6 +16,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstance))] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Description(@"Gets role assignment schedule instances of a role assignment schedule.")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.HttpPath(Path = "/{scope}/providers/Microsoft.Authorization/roleAssignmentScheduleInstances", ApiVersion = "2020-10-01-preview")] public partial class GetAzRoleAssignmentScheduleInstance_List : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener { diff --git a/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleAssignmentScheduleRequest_Get.cs b/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleAssignmentScheduleRequest_Get.cs index 1a3f2986df8b..2624e92b504a 100644 --- a/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleAssignmentScheduleRequest_Get.cs +++ b/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleAssignmentScheduleRequest_Get.cs @@ -16,6 +16,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequest))] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Description(@"Get the specified role assignment schedule request.")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.HttpPath(Path = "/{scope}/providers/Microsoft.Authorization/roleAssignmentScheduleRequests/{roleAssignmentScheduleRequestName}", ApiVersion = "2020-10-01-preview")] public partial class GetAzRoleAssignmentScheduleRequest_Get : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener { diff --git a/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleAssignmentScheduleRequest_GetViaIdentity.cs b/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleAssignmentScheduleRequest_GetViaIdentity.cs index e4bd8235ecaa..d9f50273d767 100644 --- a/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleAssignmentScheduleRequest_GetViaIdentity.cs +++ b/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleAssignmentScheduleRequest_GetViaIdentity.cs @@ -16,6 +16,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequest))] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Description(@"Get the specified role assignment schedule request.")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.HttpPath(Path = "/{scope}/providers/Microsoft.Authorization/roleAssignmentScheduleRequests/{roleAssignmentScheduleRequestName}", ApiVersion = "2020-10-01-preview")] public partial class GetAzRoleAssignmentScheduleRequest_GetViaIdentity : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener { diff --git a/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleAssignmentScheduleRequest_List.cs b/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleAssignmentScheduleRequest_List.cs index f539a325926c..eea4c950f7d1 100644 --- a/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleAssignmentScheduleRequest_List.cs +++ b/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleAssignmentScheduleRequest_List.cs @@ -16,6 +16,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequest))] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Description(@"Gets role assignment schedule requests for a scope.")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.HttpPath(Path = "/{scope}/providers/Microsoft.Authorization/roleAssignmentScheduleRequests", ApiVersion = "2020-10-01-preview")] public partial class GetAzRoleAssignmentScheduleRequest_List : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener { diff --git a/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleAssignmentSchedule_Get.cs b/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleAssignmentSchedule_Get.cs index 6aada129a36a..3f532db3b0dc 100644 --- a/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleAssignmentSchedule_Get.cs +++ b/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleAssignmentSchedule_Get.cs @@ -16,6 +16,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedule))] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Description(@"Get the specified role assignment schedule for a resource scope")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.HttpPath(Path = "/{scope}/providers/Microsoft.Authorization/roleAssignmentSchedules/{roleAssignmentScheduleName}", ApiVersion = "2020-10-01-preview")] public partial class GetAzRoleAssignmentSchedule_Get : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener { diff --git a/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleAssignmentSchedule_GetViaIdentity.cs b/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleAssignmentSchedule_GetViaIdentity.cs index 5258b3c32e20..0faa60248642 100644 --- a/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleAssignmentSchedule_GetViaIdentity.cs +++ b/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleAssignmentSchedule_GetViaIdentity.cs @@ -16,6 +16,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedule))] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Description(@"Get the specified role assignment schedule for a resource scope")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.HttpPath(Path = "/{scope}/providers/Microsoft.Authorization/roleAssignmentSchedules/{roleAssignmentScheduleName}", ApiVersion = "2020-10-01-preview")] public partial class GetAzRoleAssignmentSchedule_GetViaIdentity : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener { diff --git a/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleAssignmentSchedule_List.cs b/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleAssignmentSchedule_List.cs index 2286c9f0c57e..00ea4c28d822 100644 --- a/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleAssignmentSchedule_List.cs +++ b/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleAssignmentSchedule_List.cs @@ -16,6 +16,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedule))] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Description(@"Gets role assignment schedules for a resource scope.")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.HttpPath(Path = "/{scope}/providers/Microsoft.Authorization/roleAssignmentSchedules", ApiVersion = "2020-10-01-preview")] public partial class GetAzRoleAssignmentSchedule_List : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener { diff --git a/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleEligibilityScheduleInstance_Get.cs b/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleEligibilityScheduleInstance_Get.cs index 48c6507405a6..060ca40e7653 100644 --- a/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleEligibilityScheduleInstance_Get.cs +++ b/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleEligibilityScheduleInstance_Get.cs @@ -16,6 +16,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstance))] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Description(@"Gets the specified role eligibility schedule instance.")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.HttpPath(Path = "/{scope}/providers/Microsoft.Authorization/roleEligibilityScheduleInstances/{roleEligibilityScheduleInstanceName}", ApiVersion = "2020-10-01-preview")] public partial class GetAzRoleEligibilityScheduleInstance_Get : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener { diff --git a/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleEligibilityScheduleInstance_GetViaIdentity.cs b/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleEligibilityScheduleInstance_GetViaIdentity.cs index 87f265a32c00..d873e83000c6 100644 --- a/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleEligibilityScheduleInstance_GetViaIdentity.cs +++ b/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleEligibilityScheduleInstance_GetViaIdentity.cs @@ -16,6 +16,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstance))] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Description(@"Gets the specified role eligibility schedule instance.")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.HttpPath(Path = "/{scope}/providers/Microsoft.Authorization/roleEligibilityScheduleInstances/{roleEligibilityScheduleInstanceName}", ApiVersion = "2020-10-01-preview")] public partial class GetAzRoleEligibilityScheduleInstance_GetViaIdentity : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener { diff --git a/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleEligibilityScheduleInstance_List.cs b/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleEligibilityScheduleInstance_List.cs index 64406503ec8d..30810cc8ac50 100644 --- a/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleEligibilityScheduleInstance_List.cs +++ b/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleEligibilityScheduleInstance_List.cs @@ -16,6 +16,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstance))] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Description(@"Gets role eligibility schedule instances of a role eligibility schedule.")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.HttpPath(Path = "/{scope}/providers/Microsoft.Authorization/roleEligibilityScheduleInstances", ApiVersion = "2020-10-01-preview")] public partial class GetAzRoleEligibilityScheduleInstance_List : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener { diff --git a/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleEligibilityScheduleRequest_Get.cs b/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleEligibilityScheduleRequest_Get.cs index e30e4efcd6f1..5e9e6accea08 100644 --- a/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleEligibilityScheduleRequest_Get.cs +++ b/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleEligibilityScheduleRequest_Get.cs @@ -16,6 +16,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequest))] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Description(@"Get the specified role eligibility schedule request.")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.HttpPath(Path = "/{scope}/providers/Microsoft.Authorization/roleEligibilityScheduleRequests/{roleEligibilityScheduleRequestName}", ApiVersion = "2020-10-01-preview")] public partial class GetAzRoleEligibilityScheduleRequest_Get : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener { diff --git a/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleEligibilityScheduleRequest_GetViaIdentity.cs b/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleEligibilityScheduleRequest_GetViaIdentity.cs index 0afe4966bd71..858eb2cd6f5e 100644 --- a/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleEligibilityScheduleRequest_GetViaIdentity.cs +++ b/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleEligibilityScheduleRequest_GetViaIdentity.cs @@ -16,6 +16,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequest))] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Description(@"Get the specified role eligibility schedule request.")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.HttpPath(Path = "/{scope}/providers/Microsoft.Authorization/roleEligibilityScheduleRequests/{roleEligibilityScheduleRequestName}", ApiVersion = "2020-10-01-preview")] public partial class GetAzRoleEligibilityScheduleRequest_GetViaIdentity : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener { diff --git a/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleEligibilityScheduleRequest_List.cs b/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleEligibilityScheduleRequest_List.cs index aae646451d63..f8d38bf72ec4 100644 --- a/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleEligibilityScheduleRequest_List.cs +++ b/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleEligibilityScheduleRequest_List.cs @@ -16,6 +16,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequest))] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Description(@"Gets role eligibility schedule requests for a scope.")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.HttpPath(Path = "/{scope}/providers/Microsoft.Authorization/roleEligibilityScheduleRequests", ApiVersion = "2020-10-01-preview")] public partial class GetAzRoleEligibilityScheduleRequest_List : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener { diff --git a/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleEligibilitySchedule_Get.cs b/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleEligibilitySchedule_Get.cs index 76539b8447c4..332a7ef8a24d 100644 --- a/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleEligibilitySchedule_Get.cs +++ b/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleEligibilitySchedule_Get.cs @@ -16,6 +16,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedule))] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Description(@"Get the specified role eligibility schedule for a resource scope")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.HttpPath(Path = "/{scope}/providers/Microsoft.Authorization/roleEligibilitySchedules/{roleEligibilityScheduleName}", ApiVersion = "2020-10-01-preview")] public partial class GetAzRoleEligibilitySchedule_Get : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener { diff --git a/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleEligibilitySchedule_GetViaIdentity.cs b/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleEligibilitySchedule_GetViaIdentity.cs index 89cdeeb894af..f5e61775c028 100644 --- a/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleEligibilitySchedule_GetViaIdentity.cs +++ b/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleEligibilitySchedule_GetViaIdentity.cs @@ -16,6 +16,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedule))] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Description(@"Get the specified role eligibility schedule for a resource scope")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.HttpPath(Path = "/{scope}/providers/Microsoft.Authorization/roleEligibilitySchedules/{roleEligibilityScheduleName}", ApiVersion = "2020-10-01-preview")] public partial class GetAzRoleEligibilitySchedule_GetViaIdentity : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener { diff --git a/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleEligibilitySchedule_List.cs b/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleEligibilitySchedule_List.cs index a1aca9796fbe..efcea47c1770 100644 --- a/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleEligibilitySchedule_List.cs +++ b/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleEligibilitySchedule_List.cs @@ -16,6 +16,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedule))] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Description(@"Gets role eligibility schedules for a resource scope.")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.HttpPath(Path = "/{scope}/providers/Microsoft.Authorization/roleEligibilitySchedules", ApiVersion = "2020-10-01-preview")] public partial class GetAzRoleEligibilitySchedule_List : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener { diff --git a/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleEligibleChildResource_Get.cs b/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleEligibleChildResource_Get.cs index 75fd494810ba..515226c83e9e 100644 --- a/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleEligibleChildResource_Get.cs +++ b/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleEligibleChildResource_Get.cs @@ -16,6 +16,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IEligibleChildResource))] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Description(@"Get the child resources of a resource on which user has eligible access")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.HttpPath(Path = "/{scope}/providers/Microsoft.Authorization/eligibleChildResources", ApiVersion = "2020-10-01-preview")] public partial class GetAzRoleEligibleChildResource_Get : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener { diff --git a/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleEligibleChildResource_GetViaIdentity.cs b/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleEligibleChildResource_GetViaIdentity.cs index b50ca5ddd4cc..535f193ed0e1 100644 --- a/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleEligibleChildResource_GetViaIdentity.cs +++ b/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleEligibleChildResource_GetViaIdentity.cs @@ -16,6 +16,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IEligibleChildResource))] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Description(@"Get the child resources of a resource on which user has eligible access")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.HttpPath(Path = "/{scope}/providers/Microsoft.Authorization/eligibleChildResources", ApiVersion = "2020-10-01-preview")] public partial class GetAzRoleEligibleChildResource_GetViaIdentity : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener { diff --git a/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleManagementPolicyAssignment_Get.cs b/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleManagementPolicyAssignment_Get.cs index 22011bc3ca9e..a4a0609db2fc 100644 --- a/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleManagementPolicyAssignment_Get.cs +++ b/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleManagementPolicyAssignment_Get.cs @@ -16,6 +16,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignment))] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Description(@"Get the specified role management policy assignment for a resource scope")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.HttpPath(Path = "/{scope}/providers/Microsoft.Authorization/roleManagementPolicyAssignments/{roleManagementPolicyAssignmentName}", ApiVersion = "2020-10-01-preview")] public partial class GetAzRoleManagementPolicyAssignment_Get : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener { diff --git a/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleManagementPolicyAssignment_GetViaIdentity.cs b/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleManagementPolicyAssignment_GetViaIdentity.cs index 564d5612992f..1936afdd741a 100644 --- a/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleManagementPolicyAssignment_GetViaIdentity.cs +++ b/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleManagementPolicyAssignment_GetViaIdentity.cs @@ -16,6 +16,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignment))] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Description(@"Get the specified role management policy assignment for a resource scope")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.HttpPath(Path = "/{scope}/providers/Microsoft.Authorization/roleManagementPolicyAssignments/{roleManagementPolicyAssignmentName}", ApiVersion = "2020-10-01-preview")] public partial class GetAzRoleManagementPolicyAssignment_GetViaIdentity : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener { diff --git a/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleManagementPolicyAssignment_List.cs b/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleManagementPolicyAssignment_List.cs index 6c185f08582b..f15d5b83c326 100644 --- a/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleManagementPolicyAssignment_List.cs +++ b/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleManagementPolicyAssignment_List.cs @@ -16,6 +16,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignment))] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Description(@"Gets role management assignment policies for a resource scope.")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.HttpPath(Path = "/{scope}/providers/Microsoft.Authorization/roleManagementPolicyAssignments", ApiVersion = "2020-10-01-preview")] public partial class GetAzRoleManagementPolicyAssignment_List : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener { diff --git a/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleManagementPolicy_Get.cs b/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleManagementPolicy_Get.cs index 03f50d0615f3..7ea229cd49ee 100644 --- a/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleManagementPolicy_Get.cs +++ b/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleManagementPolicy_Get.cs @@ -16,6 +16,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicy))] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Description(@"Get the specified role management policy for a resource scope")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.HttpPath(Path = "/{scope}/providers/Microsoft.Authorization/roleManagementPolicies/{roleManagementPolicyName}", ApiVersion = "2020-10-01-preview")] public partial class GetAzRoleManagementPolicy_Get : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener { diff --git a/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleManagementPolicy_GetViaIdentity.cs b/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleManagementPolicy_GetViaIdentity.cs index c2ce7a08fafa..65ec71a1adee 100644 --- a/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleManagementPolicy_GetViaIdentity.cs +++ b/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleManagementPolicy_GetViaIdentity.cs @@ -16,6 +16,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicy))] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Description(@"Get the specified role management policy for a resource scope")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.HttpPath(Path = "/{scope}/providers/Microsoft.Authorization/roleManagementPolicies/{roleManagementPolicyName}", ApiVersion = "2020-10-01-preview")] public partial class GetAzRoleManagementPolicy_GetViaIdentity : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener { diff --git a/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleManagementPolicy_List.cs b/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleManagementPolicy_List.cs index dce4e2207cdd..7e2f38d7c6a4 100644 --- a/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleManagementPolicy_List.cs +++ b/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleManagementPolicy_List.cs @@ -16,6 +16,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicy))] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Description(@"Gets role management policies for a resource scope.")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.HttpPath(Path = "/{scope}/providers/Microsoft.Authorization/roleManagementPolicies", ApiVersion = "2020-10-01-preview")] public partial class GetAzRoleManagementPolicy_List : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener { diff --git a/src/Resources/Authorization.Autorest/generated/cmdlets/NewAzRoleAssignmentScheduleRequest_CreateExpanded.cs b/src/Resources/Authorization.Autorest/generated/cmdlets/NewAzRoleAssignmentScheduleRequest_CreateExpanded.cs index 8af868cf245d..15c55d00d823 100644 --- a/src/Resources/Authorization.Autorest/generated/cmdlets/NewAzRoleAssignmentScheduleRequest_CreateExpanded.cs +++ b/src/Resources/Authorization.Autorest/generated/cmdlets/NewAzRoleAssignmentScheduleRequest_CreateExpanded.cs @@ -16,6 +16,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequest))] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Description(@"Creates a role assignment schedule request.")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.HttpPath(Path = "/{scope}/providers/Microsoft.Authorization/roleAssignmentScheduleRequests/{roleAssignmentScheduleRequestName}", ApiVersion = "2020-10-01-preview")] public partial class NewAzRoleAssignmentScheduleRequest_CreateExpanded : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener { diff --git a/src/Resources/Authorization.Autorest/generated/cmdlets/NewAzRoleEligibilityScheduleRequest_CreateExpanded.cs b/src/Resources/Authorization.Autorest/generated/cmdlets/NewAzRoleEligibilityScheduleRequest_CreateExpanded.cs index 5b567ae9b35b..41a1d9a33484 100644 --- a/src/Resources/Authorization.Autorest/generated/cmdlets/NewAzRoleEligibilityScheduleRequest_CreateExpanded.cs +++ b/src/Resources/Authorization.Autorest/generated/cmdlets/NewAzRoleEligibilityScheduleRequest_CreateExpanded.cs @@ -16,6 +16,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequest))] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Description(@"Creates a role eligibility schedule request.")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.HttpPath(Path = "/{scope}/providers/Microsoft.Authorization/roleEligibilityScheduleRequests/{roleEligibilityScheduleRequestName}", ApiVersion = "2020-10-01-preview")] public partial class NewAzRoleEligibilityScheduleRequest_CreateExpanded : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener { diff --git a/src/Resources/Authorization.Autorest/generated/cmdlets/NewAzRoleManagementPolicyAssignment_CreateExpanded.cs b/src/Resources/Authorization.Autorest/generated/cmdlets/NewAzRoleManagementPolicyAssignment_CreateExpanded.cs index 27c1cd7a40b5..2e3f635d0ff6 100644 --- a/src/Resources/Authorization.Autorest/generated/cmdlets/NewAzRoleManagementPolicyAssignment_CreateExpanded.cs +++ b/src/Resources/Authorization.Autorest/generated/cmdlets/NewAzRoleManagementPolicyAssignment_CreateExpanded.cs @@ -16,6 +16,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignment))] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Description(@"Create a role management policy assignment")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.HttpPath(Path = "/{scope}/providers/Microsoft.Authorization/roleManagementPolicyAssignments/{roleManagementPolicyAssignmentName}", ApiVersion = "2020-10-01-preview")] public partial class NewAzRoleManagementPolicyAssignment_CreateExpanded : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener { diff --git a/src/Resources/Authorization.Autorest/generated/cmdlets/RemoveAzRoleManagementPolicyAssignment_Delete.cs b/src/Resources/Authorization.Autorest/generated/cmdlets/RemoveAzRoleManagementPolicyAssignment_Delete.cs index 503fb1ec652d..cc039b8c2cd7 100644 --- a/src/Resources/Authorization.Autorest/generated/cmdlets/RemoveAzRoleManagementPolicyAssignment_Delete.cs +++ b/src/Resources/Authorization.Autorest/generated/cmdlets/RemoveAzRoleManagementPolicyAssignment_Delete.cs @@ -16,6 +16,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets [global::System.Management.Automation.OutputType(typeof(bool))] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Description(@"Delete a role management policy assignment")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.HttpPath(Path = "/{scope}/providers/Microsoft.Authorization/roleManagementPolicyAssignments/{roleManagementPolicyAssignmentName}", ApiVersion = "2020-10-01-preview")] public partial class RemoveAzRoleManagementPolicyAssignment_Delete : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener { diff --git a/src/Resources/Authorization.Autorest/generated/cmdlets/RemoveAzRoleManagementPolicyAssignment_DeleteViaIdentity.cs b/src/Resources/Authorization.Autorest/generated/cmdlets/RemoveAzRoleManagementPolicyAssignment_DeleteViaIdentity.cs index 65972483100f..02e62efc884b 100644 --- a/src/Resources/Authorization.Autorest/generated/cmdlets/RemoveAzRoleManagementPolicyAssignment_DeleteViaIdentity.cs +++ b/src/Resources/Authorization.Autorest/generated/cmdlets/RemoveAzRoleManagementPolicyAssignment_DeleteViaIdentity.cs @@ -16,6 +16,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets [global::System.Management.Automation.OutputType(typeof(bool))] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Description(@"Delete a role management policy assignment")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.HttpPath(Path = "/{scope}/providers/Microsoft.Authorization/roleManagementPolicyAssignments/{roleManagementPolicyAssignmentName}", ApiVersion = "2020-10-01-preview")] public partial class RemoveAzRoleManagementPolicyAssignment_DeleteViaIdentity : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener { diff --git a/src/Resources/Authorization.Autorest/generated/cmdlets/RemoveAzRoleManagementPolicy_Delete.cs b/src/Resources/Authorization.Autorest/generated/cmdlets/RemoveAzRoleManagementPolicy_Delete.cs index ff8c50238105..5ae0c823ab12 100644 --- a/src/Resources/Authorization.Autorest/generated/cmdlets/RemoveAzRoleManagementPolicy_Delete.cs +++ b/src/Resources/Authorization.Autorest/generated/cmdlets/RemoveAzRoleManagementPolicy_Delete.cs @@ -16,6 +16,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets [global::System.Management.Automation.OutputType(typeof(bool))] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Description(@"Delete a role management policy")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.HttpPath(Path = "/{scope}/providers/Microsoft.Authorization/roleManagementPolicies/{roleManagementPolicyName}", ApiVersion = "2020-10-01-preview")] public partial class RemoveAzRoleManagementPolicy_Delete : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener { diff --git a/src/Resources/Authorization.Autorest/generated/cmdlets/RemoveAzRoleManagementPolicy_DeleteViaIdentity.cs b/src/Resources/Authorization.Autorest/generated/cmdlets/RemoveAzRoleManagementPolicy_DeleteViaIdentity.cs index 3e30ca562c37..c3f21e8c6b1d 100644 --- a/src/Resources/Authorization.Autorest/generated/cmdlets/RemoveAzRoleManagementPolicy_DeleteViaIdentity.cs +++ b/src/Resources/Authorization.Autorest/generated/cmdlets/RemoveAzRoleManagementPolicy_DeleteViaIdentity.cs @@ -16,6 +16,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets [global::System.Management.Automation.OutputType(typeof(bool))] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Description(@"Delete a role management policy")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.HttpPath(Path = "/{scope}/providers/Microsoft.Authorization/roleManagementPolicies/{roleManagementPolicyName}", ApiVersion = "2020-10-01-preview")] public partial class RemoveAzRoleManagementPolicy_DeleteViaIdentity : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener { diff --git a/src/Resources/Authorization.Autorest/generated/cmdlets/StopAzRoleAssignmentScheduleRequest_Cancel.cs b/src/Resources/Authorization.Autorest/generated/cmdlets/StopAzRoleAssignmentScheduleRequest_Cancel.cs index 5f433864e67a..ece32811fe5f 100644 --- a/src/Resources/Authorization.Autorest/generated/cmdlets/StopAzRoleAssignmentScheduleRequest_Cancel.cs +++ b/src/Resources/Authorization.Autorest/generated/cmdlets/StopAzRoleAssignmentScheduleRequest_Cancel.cs @@ -16,6 +16,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets [global::System.Management.Automation.OutputType(typeof(bool))] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Description(@"Cancels a pending role assignment schedule request.")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.HttpPath(Path = "/{scope}/providers/Microsoft.Authorization/roleAssignmentScheduleRequests/{roleAssignmentScheduleRequestName}/cancel", ApiVersion = "2020-10-01-preview")] public partial class StopAzRoleAssignmentScheduleRequest_Cancel : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener { diff --git a/src/Resources/Authorization.Autorest/generated/cmdlets/StopAzRoleAssignmentScheduleRequest_CancelViaIdentity.cs b/src/Resources/Authorization.Autorest/generated/cmdlets/StopAzRoleAssignmentScheduleRequest_CancelViaIdentity.cs index f1e8441d3b32..cf5b9a4008ec 100644 --- a/src/Resources/Authorization.Autorest/generated/cmdlets/StopAzRoleAssignmentScheduleRequest_CancelViaIdentity.cs +++ b/src/Resources/Authorization.Autorest/generated/cmdlets/StopAzRoleAssignmentScheduleRequest_CancelViaIdentity.cs @@ -16,6 +16,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets [global::System.Management.Automation.OutputType(typeof(bool))] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Description(@"Cancels a pending role assignment schedule request.")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.HttpPath(Path = "/{scope}/providers/Microsoft.Authorization/roleAssignmentScheduleRequests/{roleAssignmentScheduleRequestName}/cancel", ApiVersion = "2020-10-01-preview")] public partial class StopAzRoleAssignmentScheduleRequest_CancelViaIdentity : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener { diff --git a/src/Resources/Authorization.Autorest/generated/cmdlets/StopAzRoleEligibilityScheduleRequest_Cancel.cs b/src/Resources/Authorization.Autorest/generated/cmdlets/StopAzRoleEligibilityScheduleRequest_Cancel.cs index 07a17881f181..b996e0401ebb 100644 --- a/src/Resources/Authorization.Autorest/generated/cmdlets/StopAzRoleEligibilityScheduleRequest_Cancel.cs +++ b/src/Resources/Authorization.Autorest/generated/cmdlets/StopAzRoleEligibilityScheduleRequest_Cancel.cs @@ -16,6 +16,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets [global::System.Management.Automation.OutputType(typeof(bool))] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Description(@"Cancels a pending role eligibility schedule request.")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.HttpPath(Path = "/{scope}/providers/Microsoft.Authorization/roleEligibilityScheduleRequests/{roleEligibilityScheduleRequestName}/cancel", ApiVersion = "2020-10-01-preview")] public partial class StopAzRoleEligibilityScheduleRequest_Cancel : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener { diff --git a/src/Resources/Authorization.Autorest/generated/cmdlets/StopAzRoleEligibilityScheduleRequest_CancelViaIdentity.cs b/src/Resources/Authorization.Autorest/generated/cmdlets/StopAzRoleEligibilityScheduleRequest_CancelViaIdentity.cs index 235b1981bd6d..dcb9b533a7f5 100644 --- a/src/Resources/Authorization.Autorest/generated/cmdlets/StopAzRoleEligibilityScheduleRequest_CancelViaIdentity.cs +++ b/src/Resources/Authorization.Autorest/generated/cmdlets/StopAzRoleEligibilityScheduleRequest_CancelViaIdentity.cs @@ -16,6 +16,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets [global::System.Management.Automation.OutputType(typeof(bool))] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Description(@"Cancels a pending role eligibility schedule request.")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.HttpPath(Path = "/{scope}/providers/Microsoft.Authorization/roleEligibilityScheduleRequests/{roleEligibilityScheduleRequestName}/cancel", ApiVersion = "2020-10-01-preview")] public partial class StopAzRoleEligibilityScheduleRequest_CancelViaIdentity : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener { diff --git a/src/Resources/Authorization.Autorest/generated/cmdlets/UpdateAzRoleManagementPolicy_UpdateExpanded.cs b/src/Resources/Authorization.Autorest/generated/cmdlets/UpdateAzRoleManagementPolicy_UpdateExpanded.cs index c283e6594389..ca2966f511ac 100644 --- a/src/Resources/Authorization.Autorest/generated/cmdlets/UpdateAzRoleManagementPolicy_UpdateExpanded.cs +++ b/src/Resources/Authorization.Autorest/generated/cmdlets/UpdateAzRoleManagementPolicy_UpdateExpanded.cs @@ -16,6 +16,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicy))] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Description(@"Update a role management policy")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.HttpPath(Path = "/{scope}/providers/Microsoft.Authorization/roleManagementPolicies/{roleManagementPolicyName}", ApiVersion = "2020-10-01-preview")] public partial class UpdateAzRoleManagementPolicy_UpdateExpanded : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener { diff --git a/src/Resources/Authorization.Autorest/generated/cmdlets/UpdateAzRoleManagementPolicy_UpdateViaIdentityExpanded.cs b/src/Resources/Authorization.Autorest/generated/cmdlets/UpdateAzRoleManagementPolicy_UpdateViaIdentityExpanded.cs index 1bee60664b7f..90459e674fd7 100644 --- a/src/Resources/Authorization.Autorest/generated/cmdlets/UpdateAzRoleManagementPolicy_UpdateViaIdentityExpanded.cs +++ b/src/Resources/Authorization.Autorest/generated/cmdlets/UpdateAzRoleManagementPolicy_UpdateViaIdentityExpanded.cs @@ -16,6 +16,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicy))] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Description(@"Update a role management policy")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.HttpPath(Path = "/{scope}/providers/Microsoft.Authorization/roleManagementPolicies/{roleManagementPolicyName}", ApiVersion = "2020-10-01-preview")] public partial class UpdateAzRoleManagementPolicy_UpdateViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener { diff --git a/src/Resources/Authorization.Autorest/generated/runtime/BuildTime/Cmdlets/ExportHelpMarkdown.cs b/src/Resources/Authorization.Autorest/generated/runtime/BuildTime/Cmdlets/ExportHelpMarkdown.cs index 15666b264050..e250a5d19811 100644 --- a/src/Resources/Authorization.Autorest/generated/runtime/BuildTime/Cmdlets/ExportHelpMarkdown.cs +++ b/src/Resources/Authorization.Autorest/generated/runtime/BuildTime/Cmdlets/ExportHelpMarkdown.cs @@ -33,6 +33,9 @@ public class ExportHelpMarkdown : PSCmdlet [ValidateNotNullOrEmpty] public string ExamplesFolder { get; set; } + [Parameter()] + public SwitchParameter AddComplexInterfaceInfo { get; set; } + protected override void ProcessRecord() { try @@ -41,7 +44,7 @@ protected override void ProcessRecord() var variantGroups = FunctionInfo.Select(fi => fi.BaseObject).Cast() .Join(helpInfos, fi => fi.Name, phi => phi.CmdletName, (fi, phi) => fi.ToVariants(phi)) .Select(va => new VariantGroup(ModuleInfo.Name, va.First().CmdletName, va, String.Empty)); - WriteMarkdowns(variantGroups, ModuleInfo.ToModuleInfo(), DocsFolder, ExamplesFolder); + WriteMarkdowns(variantGroups, ModuleInfo.ToModuleInfo(), DocsFolder, ExamplesFolder, AddComplexInterfaceInfo.IsPresent); } catch (Exception ee) { diff --git a/src/Resources/Authorization.Autorest/generated/runtime/BuildTime/Cmdlets/ExportProxyCmdlet.cs b/src/Resources/Authorization.Autorest/generated/runtime/BuildTime/Cmdlets/ExportProxyCmdlet.cs index 36018f6d5a4d..fc2ea9393295 100644 --- a/src/Resources/Authorization.Autorest/generated/runtime/BuildTime/Cmdlets/ExportProxyCmdlet.cs +++ b/src/Resources/Authorization.Autorest/generated/runtime/BuildTime/Cmdlets/ExportProxyCmdlet.cs @@ -52,6 +52,9 @@ public class ExportProxyCmdlet : PSCmdlet [Parameter(Mandatory = true, ParameterSetName = "NoDocs")] public SwitchParameter ExcludeDocs { get; set; } + [Parameter(ParameterSetName = "Docs")] + public SwitchParameter AddComplexInterfaceInfo { get; set; } + protected override void ProcessRecord() { try @@ -163,7 +166,7 @@ protected override void ProcessRecord() var isValidProfile = !String.IsNullOrEmpty(profileName) && profileName != NoProfiles; var docsFolder = isValidProfile ? Path.Combine(DocsFolder, profileName) : DocsFolder; var examplesFolder = isValidProfile ? Path.Combine(ExamplesFolder, profileName) : ExamplesFolder; - WriteMarkdowns(variantGroupsByProfile, moduleInfo, docsFolder, examplesFolder); + WriteMarkdowns(variantGroupsByProfile, moduleInfo, docsFolder, examplesFolder, AddComplexInterfaceInfo.IsPresent); } } } diff --git a/src/Resources/Authorization.Autorest/generated/runtime/BuildTime/MarkdownRenderer.cs b/src/Resources/Authorization.Autorest/generated/runtime/BuildTime/MarkdownRenderer.cs index 35c91c05ef2a..45528ca3696a 100644 --- a/src/Resources/Authorization.Autorest/generated/runtime/BuildTime/MarkdownRenderer.cs +++ b/src/Resources/Authorization.Autorest/generated/runtime/BuildTime/MarkdownRenderer.cs @@ -14,7 +14,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Pow { internal static class MarkdownRenderer { - public static void WriteMarkdowns(IEnumerable variantGroups, PsModuleHelpInfo moduleHelpInfo, string docsFolder, string examplesFolder) + public static void WriteMarkdowns(IEnumerable variantGroups, PsModuleHelpInfo moduleHelpInfo, string docsFolder, string examplesFolder, bool AddComplexInterfaceInfo = true) { Directory.CreateDirectory(docsFolder); var markdownInfos = variantGroups.Where(vg => !vg.IsInternal).Select(vg => new MarkdownHelpInfo(vg, examplesFolder)).OrderBy(mhi => mhi.CmdletName).ToArray(); @@ -69,18 +69,26 @@ public static void WriteMarkdowns(IEnumerable variantGroups, PsMod } sb.Append($"## NOTES{Environment.NewLine}{Environment.NewLine}"); - sb.Append($"ALIASES{Environment.NewLine}{Environment.NewLine}"); - foreach (var alias in markdownInfo.Aliases) + if (markdownInfo.Aliases.Any()) { - sb.Append($"{alias}{Environment.NewLine}{Environment.NewLine}"); + sb.Append($"ALIASES{Environment.NewLine}{Environment.NewLine}"); } - if (markdownInfo.ComplexInterfaceInfos.Any()) + foreach (var alias in markdownInfo.Aliases) { - sb.Append($"{ComplexParameterHeader}{Environment.NewLine}"); + sb.Append($"{alias}{Environment.NewLine}{Environment.NewLine}"); } - foreach (var complexInterfaceInfo in markdownInfo.ComplexInterfaceInfos) + + if (AddComplexInterfaceInfo) { - sb.Append($"{complexInterfaceInfo.ToNoteOutput(includeDashes: true, includeBackticks: true)}{Environment.NewLine}{Environment.NewLine}"); + if (markdownInfo.ComplexInterfaceInfos.Any()) + { + sb.Append($"{ComplexParameterHeader}{Environment.NewLine}"); + } + foreach (var complexInterfaceInfo in markdownInfo.ComplexInterfaceInfos) + { + sb.Append($"{complexInterfaceInfo.ToNoteOutput(includeDashes: true, includeBackticks: true)}{Environment.NewLine}{Environment.NewLine}"); + } + } sb.Append($"## RELATED LINKS{Environment.NewLine}{Environment.NewLine}"); diff --git a/src/Resources/Authorization.Autorest/generated/runtime/BuildTime/Models/PsProxyOutputs.cs b/src/Resources/Authorization.Autorest/generated/runtime/BuildTime/Models/PsProxyOutputs.cs index 494bfb228eb9..49743fb12844 100644 --- a/src/Resources/Authorization.Autorest/generated/runtime/BuildTime/Models/PsProxyOutputs.cs +++ b/src/Resources/Authorization.Autorest/generated/runtime/BuildTime/Models/PsProxyOutputs.cs @@ -191,8 +191,15 @@ public BeginOutput(VariantGroup variantGroup) : base(variantGroup) public string GetProcessCustomAttributesAtRuntime() { - return VariantGroup.IsInternal ? "" : $@"{Indent}{Indent}$cmdInfo = Get-Command -Name $mapping[$parameterSet]{Environment.NewLine}{Indent}{Indent}[Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)"; + return VariantGroup.IsInternal ? "" : IsAzure ? $@"{Indent}{Indent}$cmdInfo = Get-Command -Name $mapping[$parameterSet] +{Indent}{Indent}[Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) +{Indent}{Indent}if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){{ +{Indent}{Indent}{Indent}[Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) +{Indent}{Indent}{Indent}[Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) +{Indent}{Indent}}}" : $@"{Indent}{Indent}$cmdInfo = Get-Command -Name $mapping[$parameterSet]{Environment.NewLine}{Indent}{Indent}[Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) +{Indent}{Indent}[Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)"; } + private string GetTelemetry() { if (!VariantGroup.IsInternal && IsAzure) diff --git a/src/Resources/Authorization.Autorest/generated/runtime/BuildTime/PsAttributes.cs b/src/Resources/Authorization.Autorest/generated/runtime/BuildTime/PsAttributes.cs index 5f13b778b2cc..d169c03237d1 100644 --- a/src/Resources/Authorization.Autorest/generated/runtime/BuildTime/PsAttributes.cs +++ b/src/Resources/Authorization.Autorest/generated/runtime/BuildTime/PsAttributes.cs @@ -48,6 +48,13 @@ public ProfileAttribute(params string[] profiles) } } + [AttributeUsage(AttributeTargets.Class)] + public class HttpPathAttribute : Attribute + { + public string Path { get; set; } + public string ApiVersion { get; set; } + } + [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property)] public class CategoryAttribute : Attribute { diff --git a/src/Resources/Authorization.Autorest/generated/runtime/MessageAttribute.cs b/src/Resources/Authorization.Autorest/generated/runtime/MessageAttribute.cs index 8683b6a12c1e..153975a55117 100644 --- a/src/Resources/Authorization.Autorest/generated/runtime/MessageAttribute.cs +++ b/src/Resources/Authorization.Autorest/generated/runtime/MessageAttribute.cs @@ -168,6 +168,11 @@ public class PreviewMessageAttribute : Attribute { public string _message; + public DateTime EstimatedGaDate { get; } + + public bool IsEstimatedGaDateSet { get; } = false; + + public PreviewMessageAttribute() { this._message = Resources.PreviewCmdletMessage; @@ -175,12 +180,26 @@ public PreviewMessageAttribute() public PreviewMessageAttribute(string message) { - this._message = message; + this._message = string.IsNullOrEmpty(message) ? Resources.PreviewCmdletMessage : message; } - public void PrintCustomAttributeInfo(System.Management.Automation.PSCmdlet psCmdlet) + public PreviewMessageAttribute(string message, string estimatedDateOfGa) : this(message) + { + if (DateTime.TryParse(estimatedDateOfGa, new CultureInfo("en-US"), DateTimeStyles.None, out DateTime result)) + { + this.EstimatedGaDate = result; + this.IsEstimatedGaDateSet = true; + } + } + + public void PrintCustomAttributeInfo(Action writeOutput) { - psCmdlet.WriteWarning(this._message); + writeOutput(this._message); + + if (IsEstimatedGaDateSet) + { + writeOutput(string.Format(Resources.PreviewCmdletETAMessage, this.EstimatedGaDate.ToShortDateString())); + } } public virtual bool IsApplicableToInvocation(InvocationInfo invocation) diff --git a/src/Resources/Authorization.Autorest/generated/runtime/MessageAttributeHelper.cs b/src/Resources/Authorization.Autorest/generated/runtime/MessageAttributeHelper.cs index 9964bfcae051..16e74e44534f 100644 --- a/src/Resources/Authorization.Autorest/generated/runtime/MessageAttributeHelper.cs +++ b/src/Resources/Authorization.Autorest/generated/runtime/MessageAttributeHelper.cs @@ -35,7 +35,7 @@ public class MessageAttributeHelper * the boundParameterNames is a list of parameters bound to the cmdlet at runtime, * We only process the Parameter beaking change attributes attached only params listed in this list (if present) * */ - public static void ProcessCustomAttributesAtRuntime(CommandInfo commandInfo, InvocationInfo invocationInfo, String parameterSet, System.Management.Automation.PSCmdlet psCmdlet) + public static void ProcessCustomAttributesAtRuntime(CommandInfo commandInfo, InvocationInfo invocationInfo, String parameterSet, System.Management.Automation.PSCmdlet psCmdlet, bool showPreviewMessage = true) { bool supressWarningOrError = false; @@ -57,36 +57,49 @@ public static void ProcessCustomAttributesAtRuntime(CommandInfo commandInfo, Inv { psCmdlet.WriteWarning("The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription."); } + + ProcessBreakingChangeAttributesAtRuntime(commandInfo, invocationInfo, parameterSet, psCmdlet); + + } + + private static void ProcessBreakingChangeAttributesAtRuntime(CommandInfo commandInfo, InvocationInfo invocationInfo, String parameterSet, System.Management.Automation.PSCmdlet psCmdlet) + { List attributes = new List(GetAllBreakingChangeAttributesInType(commandInfo, invocationInfo, parameterSet)); StringBuilder sb = new StringBuilder(); - Action appendBreakingChangeInfo = (string s) => sb.Append(s); + Action appendAttributeMessage = (string s) => sb.Append(s); if (attributes != null && attributes.Count > 0) { - appendBreakingChangeInfo(string.Format(Resources.BreakingChangesAttributesHeaderMessage, commandInfo.Name.Split('_')[0])); + appendAttributeMessage(string.Format(Resources.BreakingChangesAttributesHeaderMessage, commandInfo.Name.Split('_')[0])); foreach (GenericBreakingChangeAttribute attribute in attributes) { - attribute.PrintCustomAttributeInfo(appendBreakingChangeInfo); + attribute.PrintCustomAttributeInfo(appendAttributeMessage); } - appendBreakingChangeInfo(string.Format(Resources.BreakingChangesAttributesFooterMessage, BREAKING_CHANGE_ATTRIBUTE_INFORMATION_LINK)); + appendAttributeMessage(string.Format(Resources.BreakingChangesAttributesFooterMessage, BREAKING_CHANGE_ATTRIBUTE_INFORMATION_LINK)); psCmdlet.WriteWarning(sb.ToString()); } + } + + public static void ProcessPreviewMessageAttributesAtRuntime(CommandInfo commandInfo, InvocationInfo invocationInfo, String parameterSet, System.Management.Automation.PSCmdlet psCmdlet) + { List previewAttributes = new List(GetAllPreviewAttributesInType(commandInfo, invocationInfo)); + StringBuilder sb = new StringBuilder(); + Action appendAttributeMessage = (string s) => sb.Append(s); if (previewAttributes != null && previewAttributes.Count > 0) { foreach (PreviewMessageAttribute attribute in previewAttributes) { - attribute.PrintCustomAttributeInfo(psCmdlet); + attribute.PrintCustomAttributeInfo(appendAttributeMessage); } + psCmdlet.WriteWarning(sb.ToString()); } } - /** * This function takes in a CommandInfo (CmdletInfo or FunctionInfo) * And returns all the deprecation attributes attached to it @@ -128,6 +141,12 @@ private static IEnumerable GetAllBreakingChangeA } return invocationInfo == null ? attributeList : attributeList.Where(e => e.GetType() == typeof(ParameterSetBreakingChangeAttribute) ? ((ParameterSetBreakingChangeAttribute)e).IsApplicableToInvocation(invocationInfo, parameterSet) : e.IsApplicableToInvocation(invocationInfo)); } + + public static bool ContainsPreviewAttribute(CommandInfo commandInfo, InvocationInfo invocationInfo) + { + return GetAllPreviewAttributesInType(commandInfo, invocationInfo)?.Count() > 0; + } + private static IEnumerable GetAllPreviewAttributesInType(CommandInfo commandInfo, InvocationInfo invocationInfo) { List attributeList = new List(); diff --git a/src/Resources/Authorization.Autorest/generated/runtime/Properties/Resources.Designer.cs b/src/Resources/Authorization.Autorest/generated/runtime/Properties/Resources.Designer.cs index e1ab66eb0ccf..e6458336b53e 100644 --- a/src/Resources/Authorization.Autorest/generated/runtime/Properties/Resources.Designer.cs +++ b/src/Resources/Authorization.Autorest/generated/runtime/Properties/Resources.Designer.cs @@ -3135,7 +3135,16 @@ public static string PortalInstructionsGit } /// - /// Looks up a localized string similar to This cmdlet is in preview. The functionality may not be available in the selected subscription. + /// Looks up a localized string similar to The estimated generally available date is '{0}'.. + /// + public static string PreviewCmdletETAMessage { + get { + return ResourceManager.GetString("PreviewCmdletETAMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to This cmdlet is in preview. Its behavior is subject to change based on customer feedback.. /// public static string PreviewCmdletMessage { diff --git a/src/Resources/Authorization.Autorest/generated/runtime/Properties/Resources.resx b/src/Resources/Authorization.Autorest/generated/runtime/Properties/Resources.resx index 613700a3a418..a08a2e50172b 100644 --- a/src/Resources/Authorization.Autorest/generated/runtime/Properties/Resources.resx +++ b/src/Resources/Authorization.Autorest/generated/runtime/Properties/Resources.resx @@ -1736,7 +1736,10 @@ The type of the parameter is changing from '{0}' to '{1}'. Note : Go to {0} for steps to suppress this breaking change warning, and other information on breaking changes in Azure PowerShell. - This cmdlet is in preview. The functionality may not be available in the selected subscription. + This cmdlet is in preview. Its behavior is subject to change based on customer feedback. + + + The estimated generally available date is '{0}'. - The change is expected to take effect from Az version : '{0}' diff --git a/src/Resources/Authorization.Autorest/help/Az.Authorization.md b/src/Resources/Authorization.Autorest/help/Az.Authorization.md index d0b74b281e42..e8a294aad48c 100644 --- a/src/Resources/Authorization.Autorest/help/Az.Authorization.md +++ b/src/Resources/Authorization.Autorest/help/Az.Authorization.md @@ -1,6 +1,6 @@ --- Module Name: Az.Authorization -Module Guid: ef9a8a67-ab5b-4d21-a3ff-15127e64527d +Module Guid: 90ee7f74-51af-4e60-ae68-70c82d6f9606 Download Help Link: https://learn.microsoft.com/powershell/module/az.authorization Help Version: 1.0.0.0 Locale: en-US diff --git a/src/Resources/Authorization.Autorest/help/Get-AzRoleAssignmentSchedule.md b/src/Resources/Authorization.Autorest/help/Get-AzRoleAssignmentSchedule.md index 0a00eeaa9417..c6e53e115601 100644 --- a/src/Resources/Authorization.Autorest/help/Get-AzRoleAssignmentSchedule.md +++ b/src/Resources/Authorization.Autorest/help/Get-AzRoleAssignmentSchedule.md @@ -212,24 +212,5 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ## NOTES -ALIASES - -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 - - `[Id ]`: Resource identity path - - `[RoleAssignmentScheduleInstanceName ]`: The name (hash of schedule name + time) of the role assignment schedule to get. - - `[RoleAssignmentScheduleName ]`: The name (guid) of the role assignment schedule to get. - - `[RoleAssignmentScheduleRequestName ]`: The name of the role assignment to create. It can be any valid GUID. - - `[RoleEligibilityScheduleInstanceName ]`: The name (hash of schedule name + time) of the role eligibility schedule to get. - - `[RoleEligibilityScheduleName ]`: The name (guid) of the role eligibility schedule to get. - - `[RoleEligibilityScheduleRequestName ]`: The name of the role eligibility to create. It can be any valid GUID. - - `[RoleManagementPolicyAssignmentName ]`: The name of format {guid_guid} the role management policy assignment to get. - - `[RoleManagementPolicyName ]`: The name (guid) of the role management policy to get. - - `[Scope ]`: The scope of the role management policy. - ## RELATED LINKS diff --git a/src/Resources/Authorization.Autorest/help/Get-AzRoleAssignmentScheduleInstance.md b/src/Resources/Authorization.Autorest/help/Get-AzRoleAssignmentScheduleInstance.md index 5f2d8a5fc949..a37ee5416d57 100644 --- a/src/Resources/Authorization.Autorest/help/Get-AzRoleAssignmentScheduleInstance.md +++ b/src/Resources/Authorization.Autorest/help/Get-AzRoleAssignmentScheduleInstance.md @@ -213,24 +213,5 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ## NOTES -ALIASES - -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 - - `[Id ]`: Resource identity path - - `[RoleAssignmentScheduleInstanceName ]`: The name (hash of schedule name + time) of the role assignment schedule to get. - - `[RoleAssignmentScheduleName ]`: The name (guid) of the role assignment schedule to get. - - `[RoleAssignmentScheduleRequestName ]`: The name of the role assignment to create. It can be any valid GUID. - - `[RoleEligibilityScheduleInstanceName ]`: The name (hash of schedule name + time) of the role eligibility schedule to get. - - `[RoleEligibilityScheduleName ]`: The name (guid) of the role eligibility schedule to get. - - `[RoleEligibilityScheduleRequestName ]`: The name of the role eligibility to create. It can be any valid GUID. - - `[RoleManagementPolicyAssignmentName ]`: The name of format {guid_guid} the role management policy assignment to get. - - `[RoleManagementPolicyName ]`: The name (guid) of the role management policy to get. - - `[Scope ]`: The scope of the role management policy. - ## RELATED LINKS diff --git a/src/Resources/Authorization.Autorest/help/Get-AzRoleAssignmentScheduleRequest.md b/src/Resources/Authorization.Autorest/help/Get-AzRoleAssignmentScheduleRequest.md index 22dac0c80e2c..1656f893ecef 100644 --- a/src/Resources/Authorization.Autorest/help/Get-AzRoleAssignmentScheduleRequest.md +++ b/src/Resources/Authorization.Autorest/help/Get-AzRoleAssignmentScheduleRequest.md @@ -197,24 +197,5 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ## NOTES -ALIASES - -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 - - `[Id ]`: Resource identity path - - `[RoleAssignmentScheduleInstanceName ]`: The name (hash of schedule name + time) of the role assignment schedule to get. - - `[RoleAssignmentScheduleName ]`: The name (guid) of the role assignment schedule to get. - - `[RoleAssignmentScheduleRequestName ]`: The name of the role assignment to create. It can be any valid GUID. - - `[RoleEligibilityScheduleInstanceName ]`: The name (hash of schedule name + time) of the role eligibility schedule to get. - - `[RoleEligibilityScheduleName ]`: The name (guid) of the role eligibility schedule to get. - - `[RoleEligibilityScheduleRequestName ]`: The name of the role eligibility to create. It can be any valid GUID. - - `[RoleManagementPolicyAssignmentName ]`: The name of format {guid_guid} the role management policy assignment to get. - - `[RoleManagementPolicyName ]`: The name (guid) of the role management policy to get. - - `[Scope ]`: The scope of the role management policy. - ## RELATED LINKS diff --git a/src/Resources/Authorization.Autorest/help/Get-AzRoleEligibilitySchedule.md b/src/Resources/Authorization.Autorest/help/Get-AzRoleEligibilitySchedule.md index 16bda68d90bd..4f3e498cb095 100644 --- a/src/Resources/Authorization.Autorest/help/Get-AzRoleEligibilitySchedule.md +++ b/src/Resources/Authorization.Autorest/help/Get-AzRoleEligibilitySchedule.md @@ -212,24 +212,5 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ## NOTES -ALIASES - -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 - - `[Id ]`: Resource identity path - - `[RoleAssignmentScheduleInstanceName ]`: The name (hash of schedule name + time) of the role assignment schedule to get. - - `[RoleAssignmentScheduleName ]`: The name (guid) of the role assignment schedule to get. - - `[RoleAssignmentScheduleRequestName ]`: The name of the role assignment to create. It can be any valid GUID. - - `[RoleEligibilityScheduleInstanceName ]`: The name (hash of schedule name + time) of the role eligibility schedule to get. - - `[RoleEligibilityScheduleName ]`: The name (guid) of the role eligibility schedule to get. - - `[RoleEligibilityScheduleRequestName ]`: The name of the role eligibility to create. It can be any valid GUID. - - `[RoleManagementPolicyAssignmentName ]`: The name of format {guid_guid} the role management policy assignment to get. - - `[RoleManagementPolicyName ]`: The name (guid) of the role management policy to get. - - `[Scope ]`: The scope of the role management policy. - ## RELATED LINKS diff --git a/src/Resources/Authorization.Autorest/help/Get-AzRoleEligibilityScheduleInstance.md b/src/Resources/Authorization.Autorest/help/Get-AzRoleEligibilityScheduleInstance.md index 9b7500c41e14..84739d048fd7 100644 --- a/src/Resources/Authorization.Autorest/help/Get-AzRoleEligibilityScheduleInstance.md +++ b/src/Resources/Authorization.Autorest/help/Get-AzRoleEligibilityScheduleInstance.md @@ -213,24 +213,5 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ## NOTES -ALIASES - -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 - - `[Id ]`: Resource identity path - - `[RoleAssignmentScheduleInstanceName ]`: The name (hash of schedule name + time) of the role assignment schedule to get. - - `[RoleAssignmentScheduleName ]`: The name (guid) of the role assignment schedule to get. - - `[RoleAssignmentScheduleRequestName ]`: The name of the role assignment to create. It can be any valid GUID. - - `[RoleEligibilityScheduleInstanceName ]`: The name (hash of schedule name + time) of the role eligibility schedule to get. - - `[RoleEligibilityScheduleName ]`: The name (guid) of the role eligibility schedule to get. - - `[RoleEligibilityScheduleRequestName ]`: The name of the role eligibility to create. It can be any valid GUID. - - `[RoleManagementPolicyAssignmentName ]`: The name of format {guid_guid} the role management policy assignment to get. - - `[RoleManagementPolicyName ]`: The name (guid) of the role management policy to get. - - `[Scope ]`: The scope of the role management policy. - ## RELATED LINKS diff --git a/src/Resources/Authorization.Autorest/help/Get-AzRoleEligibilityScheduleRequest.md b/src/Resources/Authorization.Autorest/help/Get-AzRoleEligibilityScheduleRequest.md index 6f50be243c82..52a34c7e8b1d 100644 --- a/src/Resources/Authorization.Autorest/help/Get-AzRoleEligibilityScheduleRequest.md +++ b/src/Resources/Authorization.Autorest/help/Get-AzRoleEligibilityScheduleRequest.md @@ -197,24 +197,5 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ## NOTES -ALIASES - -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 - - `[Id ]`: Resource identity path - - `[RoleAssignmentScheduleInstanceName ]`: The name (hash of schedule name + time) of the role assignment schedule to get. - - `[RoleAssignmentScheduleName ]`: The name (guid) of the role assignment schedule to get. - - `[RoleAssignmentScheduleRequestName ]`: The name of the role assignment to create. It can be any valid GUID. - - `[RoleEligibilityScheduleInstanceName ]`: The name (hash of schedule name + time) of the role eligibility schedule to get. - - `[RoleEligibilityScheduleName ]`: The name (guid) of the role eligibility schedule to get. - - `[RoleEligibilityScheduleRequestName ]`: The name of the role eligibility to create. It can be any valid GUID. - - `[RoleManagementPolicyAssignmentName ]`: The name of format {guid_guid} the role management policy assignment to get. - - `[RoleManagementPolicyName ]`: The name (guid) of the role management policy to get. - - `[Scope ]`: The scope of the role management policy. - ## RELATED LINKS diff --git a/src/Resources/Authorization.Autorest/help/Get-AzRoleEligibleChildResource.md b/src/Resources/Authorization.Autorest/help/Get-AzRoleEligibleChildResource.md index 065636961754..c8d7a0b7d6d6 100644 --- a/src/Resources/Authorization.Autorest/help/Get-AzRoleEligibleChildResource.md +++ b/src/Resources/Authorization.Autorest/help/Get-AzRoleEligibleChildResource.md @@ -143,24 +143,5 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ## NOTES -ALIASES - -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 - - `[Id ]`: Resource identity path - - `[RoleAssignmentScheduleInstanceName ]`: The name (hash of schedule name + time) of the role assignment schedule to get. - - `[RoleAssignmentScheduleName ]`: The name (guid) of the role assignment schedule to get. - - `[RoleAssignmentScheduleRequestName ]`: The name of the role assignment to create. It can be any valid GUID. - - `[RoleEligibilityScheduleInstanceName ]`: The name (hash of schedule name + time) of the role eligibility schedule to get. - - `[RoleEligibilityScheduleName ]`: The name (guid) of the role eligibility schedule to get. - - `[RoleEligibilityScheduleRequestName ]`: The name of the role eligibility to create. It can be any valid GUID. - - `[RoleManagementPolicyAssignmentName ]`: The name of format {guid_guid} the role management policy assignment to get. - - `[RoleManagementPolicyName ]`: The name (guid) of the role management policy to get. - - `[Scope ]`: The scope of the role management policy. - ## RELATED LINKS diff --git a/src/Resources/Authorization.Autorest/help/Get-AzRoleManagementPolicy.md b/src/Resources/Authorization.Autorest/help/Get-AzRoleManagementPolicy.md index 57dc8ba64c03..44763471f8f2 100644 --- a/src/Resources/Authorization.Autorest/help/Get-AzRoleManagementPolicy.md +++ b/src/Resources/Authorization.Autorest/help/Get-AzRoleManagementPolicy.md @@ -141,24 +141,5 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ## NOTES -ALIASES - -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 - - `[Id ]`: Resource identity path - - `[RoleAssignmentScheduleInstanceName ]`: The name (hash of schedule name + time) of the role assignment schedule to get. - - `[RoleAssignmentScheduleName ]`: The name (guid) of the role assignment schedule to get. - - `[RoleAssignmentScheduleRequestName ]`: The name of the role assignment to create. It can be any valid GUID. - - `[RoleEligibilityScheduleInstanceName ]`: The name (hash of schedule name + time) of the role eligibility schedule to get. - - `[RoleEligibilityScheduleName ]`: The name (guid) of the role eligibility schedule to get. - - `[RoleEligibilityScheduleRequestName ]`: The name of the role eligibility to create. It can be any valid GUID. - - `[RoleManagementPolicyAssignmentName ]`: The name of format {guid_guid} the role management policy assignment to get. - - `[RoleManagementPolicyName ]`: The name (guid) of the role management policy to get. - - `[Scope ]`: The scope of the role management policy. - ## RELATED LINKS diff --git a/src/Resources/Authorization.Autorest/help/Get-AzRoleManagementPolicyAssignment.md b/src/Resources/Authorization.Autorest/help/Get-AzRoleManagementPolicyAssignment.md index c69203918adc..7f6be71f8394 100644 --- a/src/Resources/Authorization.Autorest/help/Get-AzRoleManagementPolicyAssignment.md +++ b/src/Resources/Authorization.Autorest/help/Get-AzRoleManagementPolicyAssignment.md @@ -143,24 +143,5 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ## NOTES -ALIASES - -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 - - `[Id ]`: Resource identity path - - `[RoleAssignmentScheduleInstanceName ]`: The name (hash of schedule name + time) of the role assignment schedule to get. - - `[RoleAssignmentScheduleName ]`: The name (guid) of the role assignment schedule to get. - - `[RoleAssignmentScheduleRequestName ]`: The name of the role assignment to create. It can be any valid GUID. - - `[RoleEligibilityScheduleInstanceName ]`: The name (hash of schedule name + time) of the role eligibility schedule to get. - - `[RoleEligibilityScheduleName ]`: The name (guid) of the role eligibility schedule to get. - - `[RoleEligibilityScheduleRequestName ]`: The name of the role eligibility to create. It can be any valid GUID. - - `[RoleManagementPolicyAssignmentName ]`: The name of format {guid_guid} the role management policy assignment to get. - - `[RoleManagementPolicyName ]`: The name (guid) of the role management policy to get. - - `[Scope ]`: The scope of the role management policy. - ## RELATED LINKS diff --git a/src/Resources/Authorization.Autorest/help/New-AzRoleAssignmentScheduleRequest.md b/src/Resources/Authorization.Autorest/help/New-AzRoleAssignmentScheduleRequest.md index b451e90608ae..0720f007382d 100644 --- a/src/Resources/Authorization.Autorest/help/New-AzRoleAssignmentScheduleRequest.md +++ b/src/Resources/Authorization.Autorest/help/New-AzRoleAssignmentScheduleRequest.md @@ -413,7 +413,5 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ## NOTES -ALIASES - ## RELATED LINKS diff --git a/src/Resources/Authorization.Autorest/help/New-AzRoleEligibilityScheduleRequest.md b/src/Resources/Authorization.Autorest/help/New-AzRoleEligibilityScheduleRequest.md index 71c8a8d97617..5889821fbb78 100644 --- a/src/Resources/Authorization.Autorest/help/New-AzRoleEligibilityScheduleRequest.md +++ b/src/Resources/Authorization.Autorest/help/New-AzRoleEligibilityScheduleRequest.md @@ -366,7 +366,5 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ## NOTES -ALIASES - ## RELATED LINKS diff --git a/src/Resources/Authorization.Autorest/help/New-AzRoleManagementPolicyAssignment.md b/src/Resources/Authorization.Autorest/help/New-AzRoleManagementPolicyAssignment.md index ac1cfbb935ff..22f4167e0ef5 100644 --- a/src/Resources/Authorization.Autorest/help/New-AzRoleManagementPolicyAssignment.md +++ b/src/Resources/Authorization.Autorest/help/New-AzRoleManagementPolicyAssignment.md @@ -154,7 +154,5 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ## NOTES -ALIASES - ## RELATED LINKS diff --git a/src/Resources/Authorization.Autorest/help/Remove-AzRoleManagementPolicy.md b/src/Resources/Authorization.Autorest/help/Remove-AzRoleManagementPolicy.md index 496f46b83686..e4c884313ade 100644 --- a/src/Resources/Authorization.Autorest/help/Remove-AzRoleManagementPolicy.md +++ b/src/Resources/Authorization.Autorest/help/Remove-AzRoleManagementPolicy.md @@ -164,24 +164,5 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ## NOTES -ALIASES - -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 - - `[Id ]`: Resource identity path - - `[RoleAssignmentScheduleInstanceName ]`: The name (hash of schedule name + time) of the role assignment schedule to get. - - `[RoleAssignmentScheduleName ]`: The name (guid) of the role assignment schedule to get. - - `[RoleAssignmentScheduleRequestName ]`: The name of the role assignment to create. It can be any valid GUID. - - `[RoleEligibilityScheduleInstanceName ]`: The name (hash of schedule name + time) of the role eligibility schedule to get. - - `[RoleEligibilityScheduleName ]`: The name (guid) of the role eligibility schedule to get. - - `[RoleEligibilityScheduleRequestName ]`: The name of the role eligibility to create. It can be any valid GUID. - - `[RoleManagementPolicyAssignmentName ]`: The name of format {guid_guid} the role management policy assignment to get. - - `[RoleManagementPolicyName ]`: The name (guid) of the role management policy to get. - - `[Scope ]`: The scope of the role management policy. - ## RELATED LINKS diff --git a/src/Resources/Authorization.Autorest/help/Remove-AzRoleManagementPolicyAssignment.md b/src/Resources/Authorization.Autorest/help/Remove-AzRoleManagementPolicyAssignment.md index 596ddc01be37..1a7de8b21f2a 100644 --- a/src/Resources/Authorization.Autorest/help/Remove-AzRoleManagementPolicyAssignment.md +++ b/src/Resources/Authorization.Autorest/help/Remove-AzRoleManagementPolicyAssignment.md @@ -164,24 +164,5 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ## NOTES -ALIASES - -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 - - `[Id ]`: Resource identity path - - `[RoleAssignmentScheduleInstanceName ]`: The name (hash of schedule name + time) of the role assignment schedule to get. - - `[RoleAssignmentScheduleName ]`: The name (guid) of the role assignment schedule to get. - - `[RoleAssignmentScheduleRequestName ]`: The name of the role assignment to create. It can be any valid GUID. - - `[RoleEligibilityScheduleInstanceName ]`: The name (hash of schedule name + time) of the role eligibility schedule to get. - - `[RoleEligibilityScheduleName ]`: The name (guid) of the role eligibility schedule to get. - - `[RoleEligibilityScheduleRequestName ]`: The name of the role eligibility to create. It can be any valid GUID. - - `[RoleManagementPolicyAssignmentName ]`: The name of format {guid_guid} the role management policy assignment to get. - - `[RoleManagementPolicyName ]`: The name (guid) of the role management policy to get. - - `[Scope ]`: The scope of the role management policy. - ## RELATED LINKS diff --git a/src/Resources/Authorization.Autorest/help/Stop-AzRoleAssignmentScheduleRequest.md b/src/Resources/Authorization.Autorest/help/Stop-AzRoleAssignmentScheduleRequest.md index 0fd2e2f1b627..02701c5df17f 100644 --- a/src/Resources/Authorization.Autorest/help/Stop-AzRoleAssignmentScheduleRequest.md +++ b/src/Resources/Authorization.Autorest/help/Stop-AzRoleAssignmentScheduleRequest.md @@ -161,24 +161,5 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ## NOTES -ALIASES - -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 - - `[Id ]`: Resource identity path - - `[RoleAssignmentScheduleInstanceName ]`: The name (hash of schedule name + time) of the role assignment schedule to get. - - `[RoleAssignmentScheduleName ]`: The name (guid) of the role assignment schedule to get. - - `[RoleAssignmentScheduleRequestName ]`: The name of the role assignment to create. It can be any valid GUID. - - `[RoleEligibilityScheduleInstanceName ]`: The name (hash of schedule name + time) of the role eligibility schedule to get. - - `[RoleEligibilityScheduleName ]`: The name (guid) of the role eligibility schedule to get. - - `[RoleEligibilityScheduleRequestName ]`: The name of the role eligibility to create. It can be any valid GUID. - - `[RoleManagementPolicyAssignmentName ]`: The name of format {guid_guid} the role management policy assignment to get. - - `[RoleManagementPolicyName ]`: The name (guid) of the role management policy to get. - - `[Scope ]`: The scope of the role management policy. - ## RELATED LINKS diff --git a/src/Resources/Authorization.Autorest/help/Stop-AzRoleEligibilityScheduleRequest.md b/src/Resources/Authorization.Autorest/help/Stop-AzRoleEligibilityScheduleRequest.md index e15a44b87e6c..4c52fd912dd4 100644 --- a/src/Resources/Authorization.Autorest/help/Stop-AzRoleEligibilityScheduleRequest.md +++ b/src/Resources/Authorization.Autorest/help/Stop-AzRoleEligibilityScheduleRequest.md @@ -161,24 +161,5 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ## NOTES -ALIASES - -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 - - `[Id ]`: Resource identity path - - `[RoleAssignmentScheduleInstanceName ]`: The name (hash of schedule name + time) of the role assignment schedule to get. - - `[RoleAssignmentScheduleName ]`: The name (guid) of the role assignment schedule to get. - - `[RoleAssignmentScheduleRequestName ]`: The name of the role assignment to create. It can be any valid GUID. - - `[RoleEligibilityScheduleInstanceName ]`: The name (hash of schedule name + time) of the role eligibility schedule to get. - - `[RoleEligibilityScheduleName ]`: The name (guid) of the role eligibility schedule to get. - - `[RoleEligibilityScheduleRequestName ]`: The name of the role eligibility to create. It can be any valid GUID. - - `[RoleManagementPolicyAssignmentName ]`: The name of format {guid_guid} the role management policy assignment to get. - - `[RoleManagementPolicyName ]`: The name (guid) of the role management policy to get. - - `[Scope ]`: The scope of the role management policy. - ## RELATED LINKS diff --git a/src/Resources/Authorization.Autorest/help/Update-AzRoleManagementPolicy.md b/src/Resources/Authorization.Autorest/help/Update-AzRoleManagementPolicy.md index 1513e7c7f10c..f4c0ee6ca82c 100644 --- a/src/Resources/Authorization.Autorest/help/Update-AzRoleManagementPolicy.md +++ b/src/Resources/Authorization.Autorest/help/Update-AzRoleManagementPolicy.md @@ -271,34 +271,5 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ## NOTES -ALIASES - -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 - - `[Id ]`: Resource identity path - - `[RoleAssignmentScheduleInstanceName ]`: The name (hash of schedule name + time) of the role assignment schedule to get. - - `[RoleAssignmentScheduleName ]`: The name (guid) of the role assignment schedule to get. - - `[RoleAssignmentScheduleRequestName ]`: The name of the role assignment to create. It can be any valid GUID. - - `[RoleEligibilityScheduleInstanceName ]`: The name (hash of schedule name + time) of the role eligibility schedule to get. - - `[RoleEligibilityScheduleName ]`: The name (guid) of the role eligibility schedule to get. - - `[RoleEligibilityScheduleRequestName ]`: The name of the role eligibility to create. It can be any valid GUID. - - `[RoleManagementPolicyAssignmentName ]`: The name of format {guid_guid} the role management policy assignment to get. - - `[RoleManagementPolicyName ]`: The name (guid) of the role management policy to get. - - `[Scope ]`: The scope of the role management policy. - -`RULE `: The rule applied to the policy. - - `RuleType `: The type of rule - - `[Id ]`: The id of the rule. - - `[TargetCaller ]`: The caller of the setting. - - `[TargetEnforcedSetting ]`: The list of enforced settings. - - `[TargetInheritableSetting ]`: The list of inheritable settings. - - `[TargetLevel ]`: The assignment level to which it is applied. - - `[TargetObject ]`: The list of target objects. - - `[TargetOperation ]`: The type of operation. - ## RELATED LINKS diff --git a/src/Resources/MSGraph.Autorest/Az.MSGraph.format.ps1xml b/src/Resources/MSGraph.Autorest/Az.MSGraph.format.ps1xml index dfbdcf316d17..a4a509bb989e 100644 --- a/src/Resources/MSGraph.Autorest/Az.MSGraph.format.ps1xml +++ b/src/Resources/MSGraph.Autorest/Az.MSGraph.format.ps1xml @@ -42,6 +42,9 @@ + + + @@ -70,6 +73,9 @@ + + AppRoleAssignmentId + ApplicationId @@ -530,27 +536,12 @@ - - - - - - - - - - - - - - - @@ -558,39 +549,18 @@ - - - - - - - + - - DeletedDateTime - - - DisplayName - Id - - OdataId - - - OdataType - AppRoleId - - CreatedDateTime - PrincipalDisplayName @@ -598,13 +568,7 @@ PrincipalId - PrincipalType - - - ResourceDisplayName - - - ResourceId + CreatedDateTime @@ -699,6 +663,28 @@ + + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphAppRoleAssignmentCollectionResponse + + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphAppRoleAssignmentCollectionResponse + + + + + + + + + + + + OdataNextLink + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphAssignedPlan diff --git a/src/Resources/MSGraph.Autorest/Az.MSGraph.psd1 b/src/Resources/MSGraph.Autorest/Az.MSGraph.psd1 index 615d621bf680..049f6a5a71c8 100644 --- a/src/Resources/MSGraph.Autorest/Az.MSGraph.psd1 +++ b/src/Resources/MSGraph.Autorest/Az.MSGraph.psd1 @@ -11,7 +11,7 @@ DotNetFrameworkVersion = '4.7.2' RequiredAssemblies = './bin/Az.MSGraph.private.dll' FormatsToProcess = './Az.MSGraph.format.ps1xml' - FunctionsToExport = 'Add-AzADAppPermission', 'Add-AzADGroupMember', 'Get-AzADAppCredential', 'Get-AzADAppFederatedCredential', 'Get-AzADApplication', 'Get-AzADAppPermission', 'Get-AzADGroup', 'Get-AzADGroupMember', 'Get-AzADGroupOwner', 'Get-AzADOrganization', 'Get-AzADServicePrincipal', 'Get-AzADSpCredential', 'Get-AzADUser', 'New-AzADAppCredential', 'New-AzADAppFederatedCredential', 'New-AzADApplication', 'New-AzADGroup', 'New-AzADGroupOwner', 'New-AzADServicePrincipal', 'New-AzADSpCredential', 'New-AzADUser', 'Remove-AzADAppCredential', 'Remove-AzADAppFederatedCredential', 'Remove-AzADApplication', 'Remove-AzADAppPermission', 'Remove-AzADGroup', 'Remove-AzADGroupMember', 'Remove-AzADGroupOwner', 'Remove-AzADServicePrincipal', 'Remove-AzADSpCredential', 'Remove-AzADUser', 'Update-AzADAppFederatedCredential', 'Update-AzADApplication', 'Update-AzADGroup', 'Update-AzADServicePrincipal', 'Update-AzADUser', '*' + FunctionsToExport = 'Add-AzADAppPermission', 'Add-AzADGroupMember', 'Get-AzADAppCredential', 'Get-AzADAppFederatedCredential', 'Get-AzADApplication', 'Get-AzADAppPermission', 'Get-AzADGroup', 'Get-AzADGroupMember', 'Get-AzADGroupOwner', 'Get-AzADOrganization', 'Get-AzADServicePrincipal', 'Get-AzADServicePrincipalAppRoleAssignment', 'Get-AzADSpCredential', 'Get-AzADUser', 'New-AzADAppCredential', 'New-AzADAppFederatedCredential', 'New-AzADApplication', 'New-AzADGroup', 'New-AzADGroupOwner', 'New-AzADServicePrincipal', 'New-AzADServicePrincipalAppRoleAssignment', 'New-AzADSpCredential', 'New-AzADUser', 'Remove-AzADAppCredential', 'Remove-AzADAppFederatedCredential', 'Remove-AzADApplication', 'Remove-AzADAppPermission', 'Remove-AzADGroup', 'Remove-AzADGroupMember', 'Remove-AzADGroupOwner', 'Remove-AzADServicePrincipal', 'Remove-AzADServicePrincipalAppRoleAssignment', 'Remove-AzADSpCredential', 'Remove-AzADUser', 'Update-AzADAppFederatedCredential', 'Update-AzADApplication', 'Update-AzADGroup', 'Update-AzADServicePrincipal', 'Update-AzADServicePrincipalAppRoleAssignment', 'Update-AzADUser', '*' AliasesToExport = 'Get-AzADServicePrincipalCredential', 'New-AzADServicePrincipalCredential', 'Remove-AzADServicePrincipalCredential', 'Set-AzADApplication', 'Set-AzADServicePrincipal', 'Set-AzADUser', '*' PrivateData = @{ PSData = @{ diff --git a/src/Resources/MSGraph.Autorest/README.md b/src/Resources/MSGraph.Autorest/README.md index 3333aee344c8..8650fa50c6e9 100644 --- a/src/Resources/MSGraph.Autorest/README.md +++ b/src/Resources/MSGraph.Autorest/README.md @@ -176,7 +176,8 @@ directive: - where: subject: ^applicationfederatedidentitycredential$|GroupGraphRefMember$|grouprefmember$|groupmember$ set: - preview-message: This cmdlet is using API version beta which is under preview. + preview-announcement: + preview-message: This cmdlet is using API version beta which is under preview. - where: subject: ^applicationfederatedidentitycredentials$ @@ -194,6 +195,33 @@ directive: set: property-name: Items + - where: + subject: serviceprincipalapproleassignment$ + verb: New + hide: true + + - where: + subject: serviceprincipalapproleassignment$ + parameter-name: ^DeletedDateTime$ + hide: true + + - where: + verb: Update + subject: serviceprincipalapproleassignment$ + parameter-name: ^PrincipalId$|^DisplayName$|^ResourceDisplayName$|^ResourceId$ + hide: true + + - where: + model-name: MicrosoftGraphAppRoleAssignment + set: + format-table: + properties: + - Id + - AppRoleId + - PrincipalDisplayName + - PrincipalId + - CreatedDateTime + - where: subject: application$|applicationpassword$|applicationkey$|serviceprincipal$|serviceprincipalpassword$|serviceprincipalkey$|groupmember$|user$|GroupGraphRefMember$|grouprefmember$ hide: true diff --git a/src/Resources/MSGraph.Autorest/custom/New-AzADServicePrincipalAppRoleAssignment.ps1 b/src/Resources/MSGraph.Autorest/custom/New-AzADServicePrincipalAppRoleAssignment.ps1 new file mode 100644 index 000000000000..e21ebdba9a44 --- /dev/null +++ b/src/Resources/MSGraph.Autorest/custom/New-AzADServicePrincipalAppRoleAssignment.ps1 @@ -0,0 +1,185 @@ + +# ---------------------------------------------------------------------------------- +# 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 new navigation property to appRoleAssignments for servicePrincipals +.Description +Create new navigation property to appRoleAssignments for servicePrincipals +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRoleAssignment +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRoleAssignment +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +BODY : Represents an Azure Active Directory object. The directoryObject type is the base type for many other directory entity types. + [(Any) ]: This indicates any property can be added to this object. + [DeletedDateTime ]: + [DisplayName ]: The name displayed in directory + [AppRoleId ]: The identifier (id) for the app role which is assigned to the principal. This app role must be exposed in the appRoles property on the resource application's service principal (resourceId). If the resource application has not declared any app roles, a default app role ID of 00000000-0000-0000-0000-000000000000 can be specified to signal that the principal is assigned to the resource app without any specific app roles. Required on create. + [PrincipalId ]: The unique identifier (id) for the user, group or service principal being granted the app role. Required on create. + [ResourceDisplayName ]: The display name of the resource app's service principal to which the assignment is made. + [ResourceId ]: The unique identifier (id) for the resource service principal for which the assignment is made. Required on create. Supports $filter (eq only). +.Link +https://learn.microsoft.com/powershell/module/az.resources/new-azadserviceprincipalapproleassignment +#> +function New-AzADServicePrincipalAppRoleAssignment { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRoleAssignment])] +[CmdletBinding(DefaultParameterSetName='ObjectIdWithResourceIdParameterSet', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName = 'ObjectIdWithResourceIdParameterSet', Mandatory)] + [Parameter(ParameterSetName = 'ObjectIdWithResourceDisplayNameParameterSet', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Path')] + [System.String] + # The unique identifier (id) for the user, group or service principal being granted the app role. + # Required on create. + ${ServicePrincipalId}, + + [Parameter(ParameterSetName = 'SPNWithResourceIdParameterSet', Mandatory)] + [Parameter(ParameterSetName = 'SPNWithResourceDisplayNameParameterSet', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] + [System.String] + # The name displayed in directory + ${ServicePrincipalDisplayName}, + + [Parameter()] # ParameterSetName='CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] + [System.Collections.Hashtable] + # Additional Parameters + ${AdditionalProperties}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] + [System.String] + # The identifier (id) for the app role which is assigned to the principal. + # This app role must be exposed in the appRoles property on the resource application's service principal (resourceId). + # If the resource application has not declared any app roles, a default app role ID of 00000000-0000-0000-0000-000000000000 can be specified to signal that the principal is assigned to the resource app without any specific app roles. + # Required on create. + ${AppRoleId}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] + [System.DateTime] + # . + ${DeletedDateTime}, + + [Parameter(ParameterSetName = 'ObjectIdWithResourceIdParameterSet', Mandatory)] + [Parameter(ParameterSetName = 'SPNWithResourceIdParameterSet', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] + [System.String] + # The unique identifier (id) for the resource service principal for which the assignment is made. + # Required on create. + # Supports $filter (eq only). + ${ResourceId}, + + [Parameter(ParameterSetName = 'ObjectIdWithResourceDisplayNameParameterSet', Mandatory)] + [Parameter(ParameterSetName = 'SPNWithResourceDisplayNameParameterSet', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] + [System.String] + # The display name of the resource app's service principal to which the assignment is made. + ${ResourceDisplayName}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +process { + switch ($PSCmdlet.ParameterSetName) { + {($_ -eq 'SPNWithResourceIdParameterSet') -or ($_ -eq 'SPNWithResourceDisplayNameParameterSet')}{ + if ($PSBoundParameters['ServicePrincipalDisplayName']) { + $PSBoundParameters['DisplayName'] = $PSBoundParameters['ServicePrincipalDisplayName'] + $null = $PSBoundParameters.Remove('ServicePrincipalDisplayName') + + $sp = Get-AzADServicePrincipal -DisplayName $PSBoundParameters['DisplayName'] + if($null -eq $sp) { + Write-Error "Cannot find service principal by DisplayName $($PSBoundParameters['DisplayName'])" + } + + $PSBoundParameters['ServicePrincipalId'] = $sp.Id + } + } + + {($_ -eq 'SPNWithResourceDisplayNameParameterSet') -or ($_ -eq 'ObjectIdWithResourceDisplayNameParameterSet')} { + if ($PSBoundParameters['ResourceDisplayName']) { + $sp = Get-AzADServicePrincipal -DisplayName $PSBoundParameters['ResourceDisplayName'] + if($null -eq $sp) { + Write-Error "Cannot find resource service principal by ResourceDisplayName $($PSBoundParameters['ResourceDisplayName'])" + } + + $PSBoundParameters['ResourceId'] = $sp.Id + } + } + } + + $PSBoundParameters['PrincipalId'] = $PSBoundParameters['ServicePrincipalId'] + + . Az.MSGraph.internal\New-AzADServicePrincipalAppRoleAssignment @PSBoundParameters + } + +} + diff --git a/src/Resources/MSGraph.Autorest/examples/Get-AzADServicePrincipalAppRoleAssignment.md b/src/Resources/MSGraph.Autorest/examples/Get-AzADServicePrincipalAppRoleAssignment.md new file mode 100644 index 000000000000..657f5671ea1b --- /dev/null +++ b/src/Resources/MSGraph.Autorest/examples/Get-AzADServicePrincipalAppRoleAssignment.md @@ -0,0 +1,27 @@ +### Example 1: List assigned app roles +```powershell +Get-AzADServicePrincipalAppRoleAssignment -ServicePrincipalId 71beb965-8347-495d-a589-c21cdde7a722 +``` + +```output +Id AppRoleId PrincipalDisplayName PrincipalId CreatedDateTime +-- --------- -------------------- ----------- --------------- +Zbm-cUeDXUmlicIc3eenIkgIm8kv9kJPj4MFhepACNE 649ae968-bdf9-4f22-bb2c-2aa1b4af0a83 funapp1214 71beb965-8347-495d-a589-c21cdde7a722 12/14/2023 7:04:28 AM +Zbm-cUeDXUmlicIc3eenIhHyPMkzw2VEh76fTc0bGtM e799a9e2-acac-4960-9ba0-6a17661fa16a funapp1214 71beb965-8347-495d-a589-c21cdde7a722 12/14/2023 6:56:52 AM +``` + +List assigned app roles. + +### Example 2: Get by AppRoleAssignmentId +```powershell +Get-AzADServicePrincipalAppRoleAssignment -ServicePrincipalId 71beb965-8347-495d-a589-c21cdde7a722 -AppRoleAssignmentId Zbm-cUeDXUmlicIc3eenIkgIm8kv9kJPj4MFhepACNE +``` + +```output +Id AppRoleId PrincipalDisplayName PrincipalId CreatedDateTime +-- --------- -------------------- ----------- --------------- +Zbm-cUeDXUmlicIc3eenIkgIm8kv9kJPj4MFhepACNE 649ae968-bdf9-4f22-bb2c-2aa1b4af0a83 funapp1214 71beb965-8347-495d-a589-c21cdde7a722 12/14/2023 7:04:28 AM +``` + +Get an assigned app role by Id. + diff --git a/src/Resources/MSGraph.Autorest/examples/New-AzADServicePrincipalAppRoleAssignment.md b/src/Resources/MSGraph.Autorest/examples/New-AzADServicePrincipalAppRoleAssignment.md new file mode 100644 index 000000000000..5d23a1688a21 --- /dev/null +++ b/src/Resources/MSGraph.Autorest/examples/New-AzADServicePrincipalAppRoleAssignment.md @@ -0,0 +1,26 @@ +### Example 1: ObjectIdWithResourceIdParameterSet +```powershell +New-AzADServicePrincipalAppRoleAssignment -ServicePrincipalId 71beb965-8347-495d-a589-c21cdde7a722 -ResourceId 351fa797-c81a-4998-9720-4c2ecb6c7abc -AppRoleId 649ae968-bdf9-4f22-bb2c-2aa1b4af0a83 +``` + +```output +Id AppRoleId PrincipalDisplayName PrincipalId CreatedDateTime +-- --------- -------------------- ----------- --------------- +Zbm-cUeDXUmlicIc3eenIkgIm8kv9kJPj4MFhepACNE 649ae968-bdf9-4f22-bb2c-2aa1b4af0a83 funapp1214 71beb965-8347-495d-a589-c21cdde7a722 12/14/2023 7:04:28 AM +``` + +Create an appRoleAssignment using ServicePrincipalId and ResourceId. + +### Example 2: SPNWithResourceDisplayNameParameterSet +```powershell +New-AzADServicePrincipalAppRoleAssignment -ServicePrincipalDisplayName funapp1214 -ResourceDisplayName nori-sp -AppRoleId 649ae968-bdf9-4f22-bb2c-2aa1b4af0a83 +``` + +```output +Id AppRoleId PrincipalDisplayName PrincipalId CreatedDateTime +-- --------- -------------------- ----------- --------------- +Zbm-cUeDXUmlicIc3eenIlqgWRlWp2hFrXIJiqP2j78 649ae968-bdf9-4f22-bb2c-2aa1b4af0a83 funapp1214 71beb965-8347-495d-a589-c21cdde7a722 12/14/2023 7:07:16 AM +``` + +Create an appRoleAssignment for service principal using ServicePrincipal DisplayName and Resource DisplayName. + diff --git a/src/Resources/MSGraph.Autorest/examples/Remove-AzADServicePrincipalAppRoleAssignment.md b/src/Resources/MSGraph.Autorest/examples/Remove-AzADServicePrincipalAppRoleAssignment.md new file mode 100644 index 000000000000..63456663aaee --- /dev/null +++ b/src/Resources/MSGraph.Autorest/examples/Remove-AzADServicePrincipalAppRoleAssignment.md @@ -0,0 +1,7 @@ +### Example 1: Remove an app role from service principal +```powershell +Remove-AzADServicePrincipalAppRoleAssignment -AppRoleAssignmentId Zbm-cUeDXUmlicIc3eenIlTWN1A5UVFMigS0D3ED-dk -ServicePrincipalId 71beb965-8347-495d-a589-c21cdde7a722 +``` + +Remove an app role from service principal. + diff --git a/src/Resources/MSGraph.Autorest/examples/Update-AzADServicePrincipalAppRoleAssignment.md b/src/Resources/MSGraph.Autorest/examples/Update-AzADServicePrincipalAppRoleAssignment.md new file mode 100644 index 000000000000..2e95a98b2f78 --- /dev/null +++ b/src/Resources/MSGraph.Autorest/examples/Update-AzADServicePrincipalAppRoleAssignment.md @@ -0,0 +1,6 @@ +### Example 1: Update the AppRoleId +```powershell +Update-AzADServicePrincipalAppRoleAssignment -AppRoleAssignmentId Zbm-cUeDXUmlicIc3eenIoFW9pZ_gRBIudKgu0gaMIw -ServicePrincipalId 71beb965-8347-495d-a589-c21cdde7a722 -AppRoleId 649ae968-bdf9-4f22-bb2c-2aa1b4af0a83 +``` + +Update the assigned App role id. \ No newline at end of file diff --git a/src/Resources/MSGraph.Autorest/exports/Get-AzADServicePrincipalAppRoleAssignment.ps1 b/src/Resources/MSGraph.Autorest/exports/Get-AzADServicePrincipalAppRoleAssignment.ps1 new file mode 100644 index 000000000000..032a0ebafd06 --- /dev/null +++ b/src/Resources/MSGraph.Autorest/exports/Get-AzADServicePrincipalAppRoleAssignment.ps1 @@ -0,0 +1,220 @@ + +# ---------------------------------------------------------------------------------- +# 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 appRoleAssignments from servicePrincipals +.Description +Get appRoleAssignments from servicePrincipals +.Example +Get-AzADServicePrincipalAppRoleAssignment -ServicePrincipalId 71beb965-8347-495d-a589-c21cdde7a722 +.Example +Get-AzADServicePrincipalAppRoleAssignment -ServicePrincipalId 71beb965-8347-495d-a589-c21cdde7a722 -AppRoleAssignmentId Zbm-cUeDXUmlicIc3eenIkgIm8kv9kJPj4MFhepACNE + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRoleAssignment +.Link +https://learn.microsoft.com/powershell/module/az.resources/get-azadserviceprincipalapproleassignment +#> +function Get-AzADServicePrincipalAppRoleAssignment { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRoleAssignment])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Path')] + [System.String] + # key: id of servicePrincipal + ${ServicePrincipalId}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Path')] + [System.String] + # key: id of appRoleAssignment + ${AppRoleAssignmentId}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Query')] + [System.String[]] + # Expand related entities + ${Expand}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Query')] + [System.String[]] + # Select properties to be returned + ${Select}, + + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Query')] + [System.Management.Automation.SwitchParameter] + # Include count of items + ${Count}, + + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Query')] + [System.String] + # Filter items by property values + ${Filter}, + + [Parameter(ParameterSetName='List')] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Query')] + [System.String[]] + # Order items by property values + ${Orderby}, + + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Query')] + [System.String] + # Search items by search phrases + ${Search}, + + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] + [System.UInt64] + # Gets only the first 'n' objects. + ${First}, + + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] + [System.UInt64] + # Ignores the first 'n' objects and then gets the remaining objects. + ${Skip}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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.MSGraph.private\Get-AzADServicePrincipalAppRoleAssignment_Get'; + List = 'Az.MSGraph.private\Get-AzADServicePrincipalAppRoleAssignment_List'; + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [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.Resources.MSGraph.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/src/Resources/MSGraph.Autorest/exports/New-AzADServicePrincipalAppRoleAssignment.ps1 b/src/Resources/MSGraph.Autorest/exports/New-AzADServicePrincipalAppRoleAssignment.ps1 new file mode 100644 index 000000000000..19a2d90c6e2b --- /dev/null +++ b/src/Resources/MSGraph.Autorest/exports/New-AzADServicePrincipalAppRoleAssignment.ps1 @@ -0,0 +1,214 @@ + +# ---------------------------------------------------------------------------------- +# 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 new navigation property to appRoleAssignments for servicePrincipals +.Description +Create new navigation property to appRoleAssignments for servicePrincipals +.Example +New-AzADServicePrincipalAppRoleAssignment -ServicePrincipalId 71beb965-8347-495d-a589-c21cdde7a722 -ResourceId 351fa797-c81a-4998-9720-4c2ecb6c7abc -AppRoleId 649ae968-bdf9-4f22-bb2c-2aa1b4af0a83 +.Example +New-AzADServicePrincipalAppRoleAssignment -ServicePrincipalDisplayName funapp1214 -ResourceDisplayName nori-sp -AppRoleId 649ae968-bdf9-4f22-bb2c-2aa1b4af0a83 + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRoleAssignment +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRoleAssignment +.Link +https://learn.microsoft.com/powershell/module/az.resources/new-azadserviceprincipalapproleassignment +#> +function New-AzADServicePrincipalAppRoleAssignment { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRoleAssignment])] +[CmdletBinding(DefaultParameterSetName='ObjectIdWithResourceIdParameterSet', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='ObjectIdWithResourceIdParameterSet', Mandatory)] + [Parameter(ParameterSetName='ObjectIdWithResourceDisplayNameParameterSet', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Path')] + [System.String] + # The unique identifier (id) for the user, group or service principal being granted the app role. + # Required on create. + ${ServicePrincipalId}, + + [Parameter(ParameterSetName='ObjectIdWithResourceIdParameterSet', Mandatory)] + [Parameter(ParameterSetName='SPNWithResourceIdParameterSet', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] + [System.String] + # The unique identifier (id) for the resource service principal for which the assignment is made. + # Required on create. + # Supports $filter (eq only). + ${ResourceId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] + [System.Collections.Hashtable] + # ParameterSetName='CreateExpanded')] + # Additional Parameters + ${AdditionalProperties}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] + [System.String] + # The identifier (id) for the app role which is assigned to the principal. + # This app role must be exposed in the appRoles property on the resource application's service principal (resourceId). + # If the resource application has not declared any app roles, a default app role ID of 00000000-0000-0000-0000-000000000000 can be specified to signal that the principal is assigned to the resource app without any specific app roles. + # Required on create. + ${AppRoleId}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] + [System.DateTime] + # . + ${DeletedDateTime}, + + [Parameter(ParameterSetName='ObjectIdWithResourceDisplayNameParameterSet', Mandatory)] + [Parameter(ParameterSetName='SPNWithResourceDisplayNameParameterSet', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] + [System.String] + # The display name of the resource app's service principal to which the assignment is made. + ${ResourceDisplayName}, + + [Parameter(ParameterSetName='SPNWithResourceDisplayNameParameterSet', Mandatory)] + [Parameter(ParameterSetName='SPNWithResourceIdParameterSet', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] + [System.String] + # The name displayed in directory + ${ServicePrincipalDisplayName}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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 = @{ + ObjectIdWithResourceIdParameterSet = 'Az.MSGraph.custom\New-AzADServicePrincipalAppRoleAssignment'; + ObjectIdWithResourceDisplayNameParameterSet = 'Az.MSGraph.custom\New-AzADServicePrincipalAppRoleAssignment'; + SPNWithResourceDisplayNameParameterSet = 'Az.MSGraph.custom\New-AzADServicePrincipalAppRoleAssignment'; + SPNWithResourceIdParameterSet = 'Az.MSGraph.custom\New-AzADServicePrincipalAppRoleAssignment'; + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [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.Resources.MSGraph.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/src/Resources/MSGraph.Autorest/exports/ProxyCmdletDefinitions.ps1 b/src/Resources/MSGraph.Autorest/exports/ProxyCmdletDefinitions.ps1 index bc9a1fe430f4..aaa468d88d74 100644 --- a/src/Resources/MSGraph.Autorest/exports/ProxyCmdletDefinitions.ps1 +++ b/src/Resources/MSGraph.Autorest/exports/ProxyCmdletDefinitions.ps1 @@ -422,40 +422,404 @@ end { } } +<# +.Synopsis +Get appRoleAssignments from servicePrincipals +.Description +Get appRoleAssignments from servicePrincipals +.Example +Get-AzADServicePrincipalAppRoleAssignment -ServicePrincipalId 71beb965-8347-495d-a589-c21cdde7a722 +.Example +Get-AzADServicePrincipalAppRoleAssignment -ServicePrincipalId 71beb965-8347-495d-a589-c21cdde7a722 -AppRoleAssignmentId Zbm-cUeDXUmlicIc3eenIkgIm8kv9kJPj4MFhepACNE + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRoleAssignment +.Link +https://learn.microsoft.com/powershell/module/az.resources/get-azadserviceprincipalapproleassignment +#> +function Get-AzADServicePrincipalAppRoleAssignment { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRoleAssignment])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Path')] + [System.String] + # key: id of servicePrincipal + ${ServicePrincipalId}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Path')] + [System.String] + # key: id of appRoleAssignment + ${AppRoleAssignmentId}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Query')] + [System.String[]] + # Expand related entities + ${Expand}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Query')] + [System.String[]] + # Select properties to be returned + ${Select}, + + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Query')] + [System.Management.Automation.SwitchParameter] + # Include count of items + ${Count}, + + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Query')] + [System.String] + # Filter items by property values + ${Filter}, + + [Parameter(ParameterSetName='List')] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Query')] + [System.String[]] + # Order items by property values + ${Orderby}, + + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Query')] + [System.String] + # Search items by search phrases + ${Search}, + + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] + [System.UInt64] + # Gets only the first 'n' objects. + ${First}, + + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] + [System.UInt64] + # Ignores the first 'n' objects and then gets the remaining objects. + ${Skip}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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.MSGraph.private\Get-AzADServicePrincipalAppRoleAssignment_Get'; + List = 'Az.MSGraph.private\Get-AzADServicePrincipalAppRoleAssignment_List'; + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [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.Resources.MSGraph.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 Delete navigation property federatedIdentityCredentials for applications .Description -Delete navigation property federatedIdentityCredentials for applications +Delete navigation property federatedIdentityCredentials for applications +.Example +Remove-AzADAppFederatedCredential -ApplicationObjectId $appObjectId -FederatedCredentialId $credentialId + +.Outputs +System.Boolean +.Link +https://learn.microsoft.com/powershell/module/az.resources/remove-azadappfederatedcredential +#> +function Remove-AzADAppFederatedCredential { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Path')] + [System.String] + # key: id of application + ${ApplicationObjectId}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Path')] + [System.String] + # key: id of federatedIdentityCredential + ${FederatedCredentialId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Header')] + [System.String] + # ETag + ${IfMatch}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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.MSGraph.private\Remove-AzADAppFederatedCredential_Delete'; + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [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.Resources.MSGraph.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 +Delete ref of navigation property owners for groups +.Description +Delete ref of navigation property owners for groups .Example -Remove-AzADAppFederatedCredential -ApplicationObjectId $appObjectId -FederatedCredentialId $credentialId +$groupId = (Get-AzADGroup -DisplayName "someGroup").Id +$ownerId = (Get-AzADGroupOwner -GroupId $groupId)[0].Id +Remove-AzADGroupOwner -GroupId $groupId -OwnerId $ownerId .Outputs System.Boolean .Link -https://learn.microsoft.com/powershell/module/az.resources/remove-azadappfederatedcredential +https://learn.microsoft.com/powershell/module/az.resources/remove-azadgroupowner #> -function Remove-AzADAppFederatedCredential { +function Remove-AzADGroupOwner { [OutputType([System.Boolean])] [CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Path')] [System.String] - # key: id of application - ${ApplicationObjectId}, + # The unique identifier of group + ${GroupId}, [Parameter(Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Path')] [System.String] - # key: id of federatedIdentityCredential - ${FederatedCredentialId}, - - [Parameter()] - [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Header')] - [System.String] - # ETag - ${IfMatch}, + # The unique identifier of directoryObject + ${OwnerId}, [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] @@ -537,7 +901,7 @@ begin { } $mapping = @{ - Delete = 'Az.MSGraph.private\Remove-AzADAppFederatedCredential_Delete'; + Delete = 'Az.MSGraph.private\Remove-AzADGroupOwner_Delete'; } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) @@ -587,34 +951,38 @@ end { <# .Synopsis -Delete ref of navigation property owners for groups +Delete navigation property appRoleAssignments for servicePrincipals .Description -Delete ref of navigation property owners for groups +Delete navigation property appRoleAssignments for servicePrincipals .Example -$groupId = (Get-AzADGroup -DisplayName "someGroup").Id -$ownerId = (Get-AzADGroupOwner -GroupId $groupId)[0].Id -Remove-AzADGroupOwner -GroupId $groupId -OwnerId $ownerId +Remove-AzADServicePrincipalAppRoleAssignment -AppRoleAssignmentId Zbm-cUeDXUmlicIc3eenIlTWN1A5UVFMigS0D3ED-dk -ServicePrincipalId 71beb965-8347-495d-a589-c21cdde7a722 .Outputs System.Boolean .Link -https://learn.microsoft.com/powershell/module/az.resources/remove-azadgroupowner +https://learn.microsoft.com/powershell/module/az.resources/remove-azadserviceprincipalapproleassignment #> -function Remove-AzADGroupOwner { +function Remove-AzADServicePrincipalAppRoleAssignment { [OutputType([System.Boolean])] [CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Path')] [System.String] - # The unique identifier of group - ${GroupId}, + # key: id of appRoleAssignment + ${AppRoleAssignmentId}, [Parameter(Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Path')] [System.String] - # The unique identifier of directoryObject - ${OwnerId}, + # key: id of servicePrincipal + ${ServicePrincipalId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Header')] + [System.String] + # ETag + ${IfMatch}, [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] @@ -696,7 +1064,7 @@ begin { } $mapping = @{ - Delete = 'Az.MSGraph.private\Remove-AzADGroupOwner_Delete'; + Delete = 'Az.MSGraph.private\Remove-AzADServicePrincipalAppRoleAssignment_Delete'; } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) @@ -1111,76 +1479,271 @@ param( # Supports $filter (eq, ne, NOT, ge, le, startsWith). ${MembershipRule}, - [Parameter()] - [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] - [System.String] - # Indicates whether the dynamic membership processing is on or paused. - # Possible values are On or Paused. - # Returned by default. - # Supports $filter (eq, ne, NOT, in). - ${MembershipRuleProcessingState}, + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] + [System.String] + # Indicates whether the dynamic membership processing is on or paused. + # Possible values are On or Paused. + # Returned by default. + # Supports $filter (eq, ne, NOT, in). + ${MembershipRuleProcessingState}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphResourceSpecificPermissionGrant[]] + # The permissions that have been granted for a group to a specific application. + # Supports $expand. + # To construct, see NOTES section for PERMISSIONGRANT properties and create a hash table. + ${PermissionGrant}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] + [System.String] + # The preferred data location for the group. + # For more information, see OneDrive Online Multi-Geo. + # Returned by default. + ${PreferredDataLocation}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] + [System.String] + # The preferred language for a Microsoft 365 group. + # Should follow ISO 639-1 Code; for example 'en-US'. + # Returned by default. + # Supports $filter (eq, ne, NOT, ge, le, in, startsWith). + ${PreferredLanguage}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Specifies whether the group is a security group. + # Returned by default. + # Supports $filter (eq, ne, NOT, in). + ${SecurityEnabled}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] + [System.String] + # Security identifier of the group, used in Windows scenarios. + # Returned by default. + ${SecurityIdentifier}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] + [System.String] + # Specifies a Microsoft 365 group's color theme. + # Possible values are Teal, Purple, Green, Blue, Pink, Orange or Red. + # Returned by default. + ${Theme}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] + [System.String] + # Specifies the group join policy and group content visibility for groups. + # Possible values are: Private, Public, or Hiddenmembership. + # Hiddenmembership can be set only for Microsoft 365 groups, when the groups are created. + # It can't be updated later. + # Other values of visibility can be updated after group creation. + # If visibility value is not specified during group creation on Microsoft Graph, a security group is created as Private by default and Microsoft 365 group is Public. + # See group visibility options to learn more. + # Returned by default. + ${Visibility}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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.MSGraph.private\Update-AzADGroup_UpdateExpanded'; + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [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.Resources.MSGraph.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 the navigation property appRoleAssignments in servicePrincipals +.Description +Update the navigation property appRoleAssignments in servicePrincipals +.Example +Update-AzADServicePrincipalAppRoleAssignment -AppRoleAssignmentId Zbm-cUeDXUmlicIc3eenIoFW9pZ_gRBIudKgu0gaMIw -ServicePrincipalId 71beb965-8347-495d-a589-c21cdde7a722 -AppRoleId 649ae968-bdf9-4f22-bb2c-2aa1b4af0a83 - [Parameter()] - [AllowEmptyCollection()] - [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphResourceSpecificPermissionGrant[]] - # The permissions that have been granted for a group to a specific application. - # Supports $expand. - # To construct, see NOTES section for PERMISSIONGRANT properties and create a hash table. - ${PermissionGrant}, +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRoleAssignment +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES - [Parameter()] - [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] - [System.String] - # The preferred data location for the group. - # For more information, see OneDrive Online Multi-Geo. - # Returned by default. - ${PreferredDataLocation}, +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()] - [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] +BODY : Represents an Azure Active Directory object. The directoryObject type is the base type for many other directory entity types. + [(Any) ]: This indicates any property can be added to this object. + [DeletedDateTime ]: + [DisplayName ]: The name displayed in directory + [AppRoleId ]: The identifier (id) for the app role which is assigned to the principal. This app role must be exposed in the appRoles property on the resource application's service principal (resourceId). If the resource application has not declared any app roles, a default app role ID of 00000000-0000-0000-0000-000000000000 can be specified to signal that the principal is assigned to the resource app without any specific app roles. Required on create. + [PrincipalId ]: The unique identifier (id) for the user, group or service principal being granted the app role. Required on create. + [ResourceDisplayName ]: The display name of the resource app's service principal to which the assignment is made. + [ResourceId ]: The unique identifier (id) for the resource service principal for which the assignment is made. Required on create. Supports $filter (eq only). +.Link +https://learn.microsoft.com/powershell/module/az.resources/update-azadserviceprincipalapproleassignment +#> +function Update-AzADServicePrincipalAppRoleAssignment { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Path')] [System.String] - # The preferred language for a Microsoft 365 group. - # Should follow ISO 639-1 Code; for example 'en-US'. - # Returned by default. - # Supports $filter (eq, ne, NOT, ge, le, in, startsWith). - ${PreferredLanguage}, + # key: id of appRoleAssignment + ${AppRoleAssignmentId}, - [Parameter()] - [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] - [System.Management.Automation.SwitchParameter] - # Specifies whether the group is a security group. - # Returned by default. - # Supports $filter (eq, ne, NOT, in). - ${SecurityEnabled}, + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Path')] + [System.String] + # key: id of servicePrincipal + ${ServicePrincipalId}, - [Parameter()] + [Parameter(ParameterSetName='Update', Mandatory, ValueFromPipeline)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] - [System.String] - # Security identifier of the group, used in Windows scenarios. - # Returned by default. - ${SecurityIdentifier}, + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRoleAssignment] + # Represents an Azure Active Directory object. + # The directoryObject type is the base type for many other directory entity types. + # To construct, see NOTES section for BODY properties and create a hash table. + ${Body}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] - [System.String] - # Specifies a Microsoft 365 group's color theme. - # Possible values are Teal, Purple, Green, Blue, Pink, Orange or Red. - # Returned by default. - ${Theme}, + [System.Collections.Hashtable] + # Additional Parameters + ${AdditionalProperties}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] - # Specifies the group join policy and group content visibility for groups. - # Possible values are: Private, Public, or Hiddenmembership. - # Hiddenmembership can be set only for Microsoft 365 groups, when the groups are created. - # It can't be updated later. - # Other values of visibility can be updated after group creation. - # If visibility value is not specified during group creation on Microsoft Graph, a security group is created as Private by default and Microsoft 365 group is Public. - # See group visibility options to learn more. - # Returned by default. - ${Visibility}, + # The identifier (id) for the app role which is assigned to the principal. + # This app role must be exposed in the appRoles property on the resource application's service principal (resourceId). + # If the resource application has not declared any app roles, a default app role ID of 00000000-0000-0000-0000-000000000000 can be specified to signal that the principal is assigned to the resource app without any specific app roles. + # Required on create. + ${AppRoleId}, [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] @@ -1262,7 +1825,8 @@ begin { } $mapping = @{ - UpdateExpanded = 'Az.MSGraph.private\Update-AzADGroup_UpdateExpanded'; + Update = 'Az.MSGraph.private\Update-AzADServicePrincipalAppRoleAssignment_Update'; + UpdateExpanded = 'Az.MSGraph.private\Update-AzADServicePrincipalAppRoleAssignment_UpdateExpanded'; } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) @@ -9463,6 +10027,205 @@ end { } } +<# +.Synopsis +Create new navigation property to appRoleAssignments for servicePrincipals +.Description +Create new navigation property to appRoleAssignments for servicePrincipals +.Example +New-AzADServicePrincipalAppRoleAssignment -ServicePrincipalId 71beb965-8347-495d-a589-c21cdde7a722 -ResourceId 351fa797-c81a-4998-9720-4c2ecb6c7abc -AppRoleId 649ae968-bdf9-4f22-bb2c-2aa1b4af0a83 +.Example +New-AzADServicePrincipalAppRoleAssignment -ServicePrincipalDisplayName funapp1214 -ResourceDisplayName nori-sp -AppRoleId 649ae968-bdf9-4f22-bb2c-2aa1b4af0a83 + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRoleAssignment +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRoleAssignment +.Link +https://learn.microsoft.com/powershell/module/az.resources/new-azadserviceprincipalapproleassignment +#> +function New-AzADServicePrincipalAppRoleAssignment { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRoleAssignment])] +[CmdletBinding(DefaultParameterSetName='ObjectIdWithResourceIdParameterSet', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='ObjectIdWithResourceIdParameterSet', Mandatory)] + [Parameter(ParameterSetName='ObjectIdWithResourceDisplayNameParameterSet', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Path')] + [System.String] + # The unique identifier (id) for the user, group or service principal being granted the app role. + # Required on create. + ${ServicePrincipalId}, + + [Parameter(ParameterSetName='ObjectIdWithResourceIdParameterSet', Mandatory)] + [Parameter(ParameterSetName='SPNWithResourceIdParameterSet', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] + [System.String] + # The unique identifier (id) for the resource service principal for which the assignment is made. + # Required on create. + # Supports $filter (eq only). + ${ResourceId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] + [System.Collections.Hashtable] + # ParameterSetName='CreateExpanded')] + # Additional Parameters + ${AdditionalProperties}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] + [System.String] + # The identifier (id) for the app role which is assigned to the principal. + # This app role must be exposed in the appRoles property on the resource application's service principal (resourceId). + # If the resource application has not declared any app roles, a default app role ID of 00000000-0000-0000-0000-000000000000 can be specified to signal that the principal is assigned to the resource app without any specific app roles. + # Required on create. + ${AppRoleId}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] + [System.DateTime] + # . + ${DeletedDateTime}, + + [Parameter(ParameterSetName='ObjectIdWithResourceDisplayNameParameterSet', Mandatory)] + [Parameter(ParameterSetName='SPNWithResourceDisplayNameParameterSet', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] + [System.String] + # The display name of the resource app's service principal to which the assignment is made. + ${ResourceDisplayName}, + + [Parameter(ParameterSetName='SPNWithResourceDisplayNameParameterSet', Mandatory)] + [Parameter(ParameterSetName='SPNWithResourceIdParameterSet', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] + [System.String] + # The name displayed in directory + ${ServicePrincipalDisplayName}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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 = @{ + ObjectIdWithResourceIdParameterSet = 'Az.MSGraph.custom\New-AzADServicePrincipalAppRoleAssignment'; + ObjectIdWithResourceDisplayNameParameterSet = 'Az.MSGraph.custom\New-AzADServicePrincipalAppRoleAssignment'; + SPNWithResourceDisplayNameParameterSet = 'Az.MSGraph.custom\New-AzADServicePrincipalAppRoleAssignment'; + SPNWithResourceIdParameterSet = 'Az.MSGraph.custom\New-AzADServicePrincipalAppRoleAssignment'; + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [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.Resources.MSGraph.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 Creates key credentials or password credentials for an service principal. diff --git a/src/Resources/MSGraph.Autorest/exports/Remove-AzADServicePrincipalAppRoleAssignment.ps1 b/src/Resources/MSGraph.Autorest/exports/Remove-AzADServicePrincipalAppRoleAssignment.ps1 new file mode 100644 index 000000000000..e94ff08d5df5 --- /dev/null +++ b/src/Resources/MSGraph.Autorest/exports/Remove-AzADServicePrincipalAppRoleAssignment.ps1 @@ -0,0 +1,178 @@ + +# ---------------------------------------------------------------------------------- +# 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 navigation property appRoleAssignments for servicePrincipals +.Description +Delete navigation property appRoleAssignments for servicePrincipals +.Example +Remove-AzADServicePrincipalAppRoleAssignment -AppRoleAssignmentId Zbm-cUeDXUmlicIc3eenIlTWN1A5UVFMigS0D3ED-dk -ServicePrincipalId 71beb965-8347-495d-a589-c21cdde7a722 + +.Outputs +System.Boolean +.Link +https://learn.microsoft.com/powershell/module/az.resources/remove-azadserviceprincipalapproleassignment +#> +function Remove-AzADServicePrincipalAppRoleAssignment { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Path')] + [System.String] + # key: id of appRoleAssignment + ${AppRoleAssignmentId}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Path')] + [System.String] + # key: id of servicePrincipal + ${ServicePrincipalId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Header')] + [System.String] + # ETag + ${IfMatch}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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.MSGraph.private\Remove-AzADServicePrincipalAppRoleAssignment_Delete'; + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [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.Resources.MSGraph.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/src/Resources/MSGraph.Autorest/exports/Update-AzADServicePrincipalAppRoleAssignment.ps1 b/src/Resources/MSGraph.Autorest/exports/Update-AzADServicePrincipalAppRoleAssignment.ps1 new file mode 100644 index 000000000000..7273f712897e --- /dev/null +++ b/src/Resources/MSGraph.Autorest/exports/Update-AzADServicePrincipalAppRoleAssignment.ps1 @@ -0,0 +1,211 @@ + +# ---------------------------------------------------------------------------------- +# 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 the navigation property appRoleAssignments in servicePrincipals +.Description +Update the navigation property appRoleAssignments in servicePrincipals +.Example +Update-AzADServicePrincipalAppRoleAssignment -AppRoleAssignmentId Zbm-cUeDXUmlicIc3eenIoFW9pZ_gRBIudKgu0gaMIw -ServicePrincipalId 71beb965-8347-495d-a589-c21cdde7a722 -AppRoleId 649ae968-bdf9-4f22-bb2c-2aa1b4af0a83 + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRoleAssignment +.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. + +BODY : Represents an Azure Active Directory object. The directoryObject type is the base type for many other directory entity types. + [(Any) ]: This indicates any property can be added to this object. + [DeletedDateTime ]: + [DisplayName ]: The name displayed in directory + [AppRoleId ]: The identifier (id) for the app role which is assigned to the principal. This app role must be exposed in the appRoles property on the resource application's service principal (resourceId). If the resource application has not declared any app roles, a default app role ID of 00000000-0000-0000-0000-000000000000 can be specified to signal that the principal is assigned to the resource app without any specific app roles. Required on create. + [PrincipalId ]: The unique identifier (id) for the user, group or service principal being granted the app role. Required on create. + [ResourceDisplayName ]: The display name of the resource app's service principal to which the assignment is made. + [ResourceId ]: The unique identifier (id) for the resource service principal for which the assignment is made. Required on create. Supports $filter (eq only). +.Link +https://learn.microsoft.com/powershell/module/az.resources/update-azadserviceprincipalapproleassignment +#> +function Update-AzADServicePrincipalAppRoleAssignment { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Path')] + [System.String] + # key: id of appRoleAssignment + ${AppRoleAssignmentId}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Path')] + [System.String] + # key: id of servicePrincipal + ${ServicePrincipalId}, + + [Parameter(ParameterSetName='Update', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRoleAssignment] + # Represents an Azure Active Directory object. + # The directoryObject type is the base type for many other directory entity types. + # To construct, see NOTES section for BODY properties and create a hash table. + ${Body}, + + [Parameter(ParameterSetName='UpdateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] + [System.Collections.Hashtable] + # Additional Parameters + ${AdditionalProperties}, + + [Parameter(ParameterSetName='UpdateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] + [System.String] + # The identifier (id) for the app role which is assigned to the principal. + # This app role must be exposed in the appRoles property on the resource application's service principal (resourceId). + # If the resource application has not declared any app roles, a default app role ID of 00000000-0000-0000-0000-000000000000 can be specified to signal that the principal is assigned to the resource app without any specific app roles. + # Required on create. + ${AppRoleId}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Update = 'Az.MSGraph.private\Update-AzADServicePrincipalAppRoleAssignment_Update'; + UpdateExpanded = 'Az.MSGraph.private\Update-AzADServicePrincipalAppRoleAssignment_UpdateExpanded'; + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [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.Resources.MSGraph.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/src/Resources/MSGraph.Autorest/generated/api/MSGraph.cs b/src/Resources/MSGraph.Autorest/generated/api/MSGraph.cs index 5dd84d2ea9d6..c6700c2ca88e 100644 --- a/src/Resources/MSGraph.Autorest/generated/api/MSGraph.cs +++ b/src/Resources/MSGraph.Autorest/generated/api/MSGraph.cs @@ -4902,6 +4902,172 @@ public partial class MSGraph } } + /// Create new navigation property to appRoleAssignments for servicePrincipals + /// key: id of servicePrincipal + /// New navigation property + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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 ServicePrincipalsCreateAppRoleAssignments(string servicePrincipalId, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRoleAssignment body, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode.IncludeUpdate) + { + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/servicePrincipals/" + + global::System.Uri.EscapeDataString(servicePrincipalId) + + "/appRoleAssignments" + + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://graph.microsoft.com/v1.0{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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.Resources.MSGraph.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ServicePrincipalsCreateAppRoleAssignments_Call(request,onCreated,onDefault,eventListener,sender); + } + } + + /// Create new navigation property to appRoleAssignments for servicePrincipals + /// + /// New navigation property + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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 ServicePrincipalsCreateAppRoleAssignmentsViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRoleAssignment body, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode.IncludeUpdate) + { + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/servicePrincipals/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/servicePrincipals/{servicePrincipal-id}/appRoleAssignments'"); + } + + // replace URI parameters with values from identity + var servicePrincipalId = _match.Groups["servicePrincipal-id"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/servicePrincipals/" + + servicePrincipalId + + "/appRoleAssignments" + + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://graph.microsoft.com/v1.0{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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.Resources.MSGraph.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ServicePrincipalsCreateAppRoleAssignments_Call(request,onCreated,onDefault,eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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 ServicePrincipalsCreateAppRoleAssignments_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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.Resources.MSGraph.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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.Created: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onCreated(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphAppRoleAssignment.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10Beta.OdataError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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. + /// + /// key: id of servicePrincipal + /// New navigation property + /// 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 ServicePrincipalsCreateAppRoleAssignments_Validate(string servicePrincipalId, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRoleAssignment body, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(servicePrincipalId),servicePrincipalId); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + /// /// Create new navigation property to federatedIdentityCredentials for servicePrincipals /// @@ -5072,9 +5238,9 @@ public partial class MSGraph } } - /// Delete navigation property federatedIdentityCredentials for servicePrincipals + /// Delete navigation property appRoleAssignments for servicePrincipals /// key: id of servicePrincipal - /// key: id of federatedIdentityCredential + /// key: id of appRoleAssignment /// ETag /// a delegate that is called when the remote service returns 204 (NoContent). /// a delegate that is called when the remote service returns default (any response code not handled @@ -5084,7 +5250,7 @@ public partial class MSGraph /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ServicePrincipalsDeleteFederatedIdentityCredentials(string servicePrincipalId, string federatedIdentityCredentialId, string ifMatch, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ServicePrincipalsDeleteAppRoleAssignments(string servicePrincipalId, string appRoleAssignmentId, string ifMatch, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) { // Constant Parameters using( NoSynchronizationContext ) @@ -5093,8 +5259,63 @@ public partial class MSGraph var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/servicePrincipals/" + global::System.Uri.EscapeDataString(servicePrincipalId) - + "/federatedIdentityCredentials/" - + global::System.Uri.EscapeDataString(federatedIdentityCredentialId) + + "/appRoleAssignments/" + + global::System.Uri.EscapeDataString(appRoleAssignmentId) + + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://graph.microsoft.com/v1.0{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ServicePrincipalsDeleteAppRoleAssignments_Call(request,onNoContent,onDefault,eventListener,sender); + } + } + + /// Delete navigation property appRoleAssignments for servicePrincipals + /// + /// ETag + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ServicePrincipalsDeleteAppRoleAssignmentsViaIdentity(global::System.String viaIdentity, string ifMatch, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) + { + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/servicePrincipals/(?[^/]+)/appRoleAssignments/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/servicePrincipals/{servicePrincipal-id}/appRoleAssignments/{appRoleAssignment-id}'"); + } + + // replace URI parameters with values from identity + var servicePrincipalId = _match.Groups["servicePrincipal-id"].Value; + var appRoleAssignmentId = _match.Groups["appRoleAssignment-id"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/servicePrincipals/" + + servicePrincipalId + + "/appRoleAssignments/" + + appRoleAssignmentId ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -5105,22 +5326,481 @@ public partial class MSGraph var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Delete, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - // add headers parameters - if (null != ifMatch) - { - request.Headers.Add("If-Match",ifMatch); - } - + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ServicePrincipalsDeleteAppRoleAssignments_Call(request,onNoContent,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 default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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 ServicePrincipalsDeleteAppRoleAssignments_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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.Resources.MSGraph.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10Beta.OdataError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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. + /// + /// key: id of servicePrincipal + /// key: id of appRoleAssignment + /// ETag + /// 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 ServicePrincipalsDeleteAppRoleAssignments_Validate(string servicePrincipalId, string appRoleAssignmentId, string ifMatch, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(servicePrincipalId),servicePrincipalId); + await eventListener.AssertNotNull(nameof(appRoleAssignmentId),appRoleAssignmentId); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + } + } + + /// Delete navigation property federatedIdentityCredentials for servicePrincipals + /// key: id of servicePrincipal + /// key: id of federatedIdentityCredential + /// ETag + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ServicePrincipalsDeleteFederatedIdentityCredentials(string servicePrincipalId, string federatedIdentityCredentialId, string ifMatch, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) + { + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/servicePrincipals/" + + global::System.Uri.EscapeDataString(servicePrincipalId) + + "/federatedIdentityCredentials/" + + global::System.Uri.EscapeDataString(federatedIdentityCredentialId) + + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://graph.microsoft.com/v1.0{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ServicePrincipalsDeleteFederatedIdentityCredentials_Call(request,onNoContent,onDefault,eventListener,sender); + } + } + + /// Delete navigation property federatedIdentityCredentials for servicePrincipals + /// + /// ETag + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ServicePrincipalsDeleteFederatedIdentityCredentialsViaIdentity(global::System.String viaIdentity, string ifMatch, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) + { + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/servicePrincipals/(?[^/]+)/federatedIdentityCredentials/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/servicePrincipals/{servicePrincipal-id}/federatedIdentityCredentials/{federatedIdentityCredential-id}'"); + } + + // replace URI parameters with values from identity + var servicePrincipalId = _match.Groups["servicePrincipal-id"].Value; + var federatedIdentityCredentialId = _match.Groups["federatedIdentityCredential-id"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/servicePrincipals/" + + servicePrincipalId + + "/federatedIdentityCredentials/" + + federatedIdentityCredentialId + + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://graph.microsoft.com/v1.0{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ServicePrincipalsDeleteFederatedIdentityCredentials_Call(request,onNoContent,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 default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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 ServicePrincipalsDeleteFederatedIdentityCredentials_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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.Resources.MSGraph.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10Beta.OdataError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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. + /// + /// key: id of servicePrincipal + /// key: id of federatedIdentityCredential + /// ETag + /// 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 ServicePrincipalsDeleteFederatedIdentityCredentials_Validate(string servicePrincipalId, string federatedIdentityCredentialId, string ifMatch, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(servicePrincipalId),servicePrincipalId); + await eventListener.AssertNotNull(nameof(federatedIdentityCredentialId),federatedIdentityCredentialId); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + } + } + + /// Get appRoleAssignments from servicePrincipals + /// key: id of servicePrincipal + /// key: id of appRoleAssignment + /// Select properties to be returned + /// Expand related entities + /// a delegate that is called 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.Resources.MSGraph.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ServicePrincipalsGetAppRoleAssignments(string servicePrincipalId, string appRoleAssignmentId, string[] Select, string[] Expand, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) + { + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/servicePrincipals/" + + global::System.Uri.EscapeDataString(servicePrincipalId) + + "/appRoleAssignments/" + + global::System.Uri.EscapeDataString(appRoleAssignmentId) + + "?" + + (null != Select && Select.Length > 0 ? "$select=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Select, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(null == each ? global::System.String.Empty : each.ToString()) ))) : global::System.String.Empty) + + "&" + + (null != Expand && Expand.Length > 0 ? "$expand=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Expand, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(null == each ? global::System.String.Empty : each.ToString()) ))) : global::System.String.Empty) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://graph.microsoft.com/v1.0{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ServicePrincipalsGetAppRoleAssignments_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Get appRoleAssignments from servicePrincipals + /// + /// Select properties to be returned + /// Expand related entities + /// a delegate that is called 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.Resources.MSGraph.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ServicePrincipalsGetAppRoleAssignmentsViaIdentity(global::System.String viaIdentity, string[] Select, string[] Expand, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) + { + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/servicePrincipals/(?[^/]+)/appRoleAssignments/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/servicePrincipals/{servicePrincipal-id}/appRoleAssignments/{appRoleAssignment-id}'"); + } + + // replace URI parameters with values from identity + var servicePrincipalId = _match.Groups["servicePrincipal-id"].Value; + var appRoleAssignmentId = _match.Groups["appRoleAssignment-id"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/servicePrincipals/" + + servicePrincipalId + + "/appRoleAssignments/" + + appRoleAssignmentId + + "?" + + (null != Select && Select.Length > 0 ? "$select=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Select, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(null == each ? global::System.String.Empty : each.ToString()) ))) : global::System.String.Empty) + + "&" + + (null != Expand && Expand.Length > 0 ? "$expand=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Expand, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(null == each ? global::System.String.Empty : each.ToString()) ))) : global::System.String.Empty) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://graph.microsoft.com/v1.0{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ServicePrincipalsGetAppRoleAssignments_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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 ServicePrincipalsGetAppRoleAssignments_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.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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.Resources.MSGraph.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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.Resources.MSGraph.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphAppRoleAssignment.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10Beta.OdataError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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. + /// + /// key: id of servicePrincipal + /// key: id of appRoleAssignment + /// Select properties to be returned + /// Expand related entities + /// 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 ServicePrincipalsGetAppRoleAssignments_Validate(string servicePrincipalId, string appRoleAssignmentId, string[] Select, string[] Expand, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(servicePrincipalId),servicePrincipalId); + await eventListener.AssertNotNull(nameof(appRoleAssignmentId),appRoleAssignmentId); + } + } + + /// Get federatedIdentityCredentials from servicePrincipals + /// key: id of servicePrincipal + /// key: id of federatedIdentityCredential + /// Select properties to be returned + /// Expand related entities + /// a delegate that is called 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.Resources.MSGraph.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ServicePrincipalsGetFederatedIdentityCredentials(string servicePrincipalId, string federatedIdentityCredentialId, string[] Select, string[] Expand, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) + { + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/servicePrincipals/" + + global::System.Uri.EscapeDataString(servicePrincipalId) + + "/federatedIdentityCredentials/" + + global::System.Uri.EscapeDataString(federatedIdentityCredentialId) + + "?" + + (null != Select && Select.Length > 0 ? "$select=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Select, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(null == each ? global::System.String.Empty : each.ToString()) ))) : global::System.String.Empty) + + "&" + + (null != Expand && Expand.Length > 0 ? "$expand=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Expand, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(null == each ? global::System.String.Empty : each.ToString()) ))) : global::System.String.Empty) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://graph.microsoft.com/v1.0{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ServicePrincipalsDeleteFederatedIdentityCredentials_Call(request,onNoContent,onDefault,eventListener,sender); + await this.ServicePrincipalsGetFederatedIdentityCredentials_Call(request,onOk,onDefault,eventListener,sender); } } - /// Delete navigation property federatedIdentityCredentials for servicePrincipals + /// Get federatedIdentityCredentials from servicePrincipals /// - /// ETag - /// a delegate that is called when the remote service returns 204 (NoContent). + /// Select properties to be returned + /// Expand related entities + /// a delegate that is called 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. @@ -5128,7 +5808,7 @@ public partial class MSGraph /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ServicePrincipalsDeleteFederatedIdentityCredentialsViaIdentity(global::System.String viaIdentity, string ifMatch, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ServicePrincipalsGetFederatedIdentityCredentialsViaIdentity(global::System.String viaIdentity, string[] Select, string[] Expand, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) { // Constant Parameters using( NoSynchronizationContext ) @@ -5150,33 +5830,30 @@ public partial class MSGraph + servicePrincipalId + "/federatedIdentityCredentials/" + federatedIdentityCredentialId - + + "?" + + (null != Select && Select.Length > 0 ? "$select=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Select, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(null == each ? global::System.String.Empty : each.ToString()) ))) : global::System.String.Empty) + + "&" + + (null != Expand && Expand.Length > 0 ? "$expand=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Expand, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(null == each ? global::System.String.Empty : each.ToString()) ))) : global::System.String.Empty) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } // generate request object var _url = new global::System.Uri($"https://graph.microsoft.com/v1.0{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Delete, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Get, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - // add headers parameters - if (null != ifMatch) - { - request.Headers.Add("If-Match",ifMatch); - } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ServicePrincipalsDeleteFederatedIdentityCredentials_Call(request,onNoContent,onDefault,eventListener,sender); + await this.ServicePrincipalsGetFederatedIdentityCredentials_Call(request,onOk,onDefault,eventListener,sender); } } /// - /// Actual wire call for method. + /// Actual wire call for method. /// /// the prepared HttpRequestMessage to send. - /// a delegate that is called when the remote service returns 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. @@ -5184,7 +5861,7 @@ public partial class MSGraph /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task ServicePrincipalsDeleteFederatedIdentityCredentials_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task ServicePrincipalsGetFederatedIdentityCredentials_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.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -5200,10 +5877,10 @@ public partial class MSGraph switch ( _response.StatusCode ) { - case global::System.Net.HttpStatusCode.NoContent: + case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onNoContent(_response); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphFederatedIdentityCredential.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: @@ -5225,29 +5902,32 @@ public partial class MSGraph } /// - /// Validation method for method. Call this like the actual + /// Validation method for method. Call this like the actual /// call, but you will get validation events back. /// /// key: id of servicePrincipal /// key: id of federatedIdentityCredential - /// ETag + /// Select properties to be returned + /// Expand related entities /// 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 ServicePrincipalsDeleteFederatedIdentityCredentials_Validate(string servicePrincipalId, string federatedIdentityCredentialId, string ifMatch, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task ServicePrincipalsGetFederatedIdentityCredentials_Validate(string servicePrincipalId, string federatedIdentityCredentialId, string[] Select, string[] Expand, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { await eventListener.AssertNotNull(nameof(servicePrincipalId),servicePrincipalId); await eventListener.AssertNotNull(nameof(federatedIdentityCredentialId),federatedIdentityCredentialId); - await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); } } - /// Get federatedIdentityCredentials from servicePrincipals + /// Get appRoleAssignments from servicePrincipals /// key: id of servicePrincipal - /// key: id of federatedIdentityCredential + /// Search items by search phrases + /// Filter items by property values + /// Include count of items + /// Order items by property values /// Select properties to be returned /// Expand related entities /// a delegate that is called when the remote service returns 200 (OK). @@ -5258,7 +5938,7 @@ public partial class MSGraph /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ServicePrincipalsGetFederatedIdentityCredentials(string servicePrincipalId, string federatedIdentityCredentialId, string[] Select, string[] Expand, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ServicePrincipalsListAppRoleAssignments(string servicePrincipalId, string Search, string Filter, bool? Count, string[] Orderby, string[] Select, string[] Expand, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) { // Constant Parameters using( NoSynchronizationContext ) @@ -5267,9 +5947,16 @@ public partial class MSGraph var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/servicePrincipals/" + global::System.Uri.EscapeDataString(servicePrincipalId) - + "/federatedIdentityCredentials/" - + global::System.Uri.EscapeDataString(federatedIdentityCredentialId) + + "/appRoleAssignments" + "?" + + (string.IsNullOrEmpty(Search) ? global::System.String.Empty : "$search=" + global::System.Uri.EscapeDataString(Search)) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Count ? global::System.String.Empty : "$count=" + global::System.Uri.EscapeDataString(Count.ToString().ToLower())) + + "&" + + (null != Orderby && Orderby.Length > 0 ? "$orderby=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Orderby, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(null == each ? global::System.String.Empty : each.ToString()) ))) : global::System.String.Empty) + + "&" + (null != Select && Select.Length > 0 ? "$select=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Select, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(null == each ? global::System.String.Empty : each.ToString()) ))) : global::System.String.Empty) + "&" + (null != Expand && Expand.Length > 0 ? "$expand=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Expand, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(null == each ? global::System.String.Empty : each.ToString()) ))) : global::System.String.Empty) @@ -5284,12 +5971,16 @@ public partial class MSGraph await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ServicePrincipalsGetFederatedIdentityCredentials_Call(request,onOk,onDefault,eventListener,sender); + await this.ServicePrincipalsListAppRoleAssignments_Call(request,onOk,onDefault,eventListener,sender); } } - /// Get federatedIdentityCredentials from servicePrincipals + /// Get appRoleAssignments from servicePrincipals /// + /// Search items by search phrases + /// Filter items by property values + /// Include count of items + /// Order items by property values /// Select properties to be returned /// Expand related entities /// a delegate that is called when the remote service returns 200 (OK). @@ -5300,29 +5991,35 @@ public partial class MSGraph /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ServicePrincipalsGetFederatedIdentityCredentialsViaIdentity(global::System.String viaIdentity, string[] Select, string[] Expand, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ServicePrincipalsListAppRoleAssignmentsViaIdentity(global::System.String viaIdentity, string Search, string Filter, bool? Count, string[] Orderby, string[] Select, string[] Expand, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) { // Constant Parameters using( NoSynchronizationContext ) { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/servicePrincipals/(?[^/]+)/federatedIdentityCredentials/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/servicePrincipals/(?[^/]+)/appRoleAssignments$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); if (!_match.Success) { - throw new global::System.Exception("Invalid identity for URI '/servicePrincipals/{servicePrincipal-id}/federatedIdentityCredentials/{federatedIdentityCredential-id}'"); + throw new global::System.Exception("Invalid identity for URI '/servicePrincipals/{servicePrincipal-id}/appRoleAssignments'"); } // replace URI parameters with values from identity var servicePrincipalId = _match.Groups["servicePrincipal-id"].Value; - var federatedIdentityCredentialId = _match.Groups["federatedIdentityCredential-id"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/servicePrincipals/" + servicePrincipalId - + "/federatedIdentityCredentials/" - + federatedIdentityCredentialId + + "/appRoleAssignments" + "?" + + (string.IsNullOrEmpty(Search) ? global::System.String.Empty : "$search=" + global::System.Uri.EscapeDataString(Search)) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Count ? global::System.String.Empty : "$count=" + global::System.Uri.EscapeDataString(Count.ToString().ToLower())) + + "&" + + (null != Orderby && Orderby.Length > 0 ? "$orderby=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Orderby, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(null == each ? global::System.String.Empty : each.ToString()) ))) : global::System.String.Empty) + + "&" + (null != Select && Select.Length > 0 ? "$select=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Select, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(null == each ? global::System.String.Empty : each.ToString()) ))) : global::System.String.Empty) + "&" + (null != Expand && Expand.Length > 0 ? "$expand=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Expand, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(null == each ? global::System.String.Empty : each.ToString()) ))) : global::System.String.Empty) @@ -5337,12 +6034,12 @@ public partial class MSGraph await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ServicePrincipalsGetFederatedIdentityCredentials_Call(request,onOk,onDefault,eventListener,sender); + await this.ServicePrincipalsListAppRoleAssignments_Call(request,onOk,onDefault,eventListener,sender); } } /// - /// Actual wire call for method. + /// Actual wire call for method. /// /// the prepared HttpRequestMessage to send. /// a delegate that is called when the remote service returns 200 (OK). @@ -5353,7 +6050,7 @@ public partial class MSGraph /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task ServicePrincipalsGetFederatedIdentityCredentials_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.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task ServicePrincipalsListAppRoleAssignments_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.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -5372,7 +6069,7 @@ public partial class MSGraph case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphFederatedIdentityCredential.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphAppRoleAssignmentCollectionResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: @@ -5394,23 +6091,27 @@ public partial class MSGraph } /// - /// 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. /// /// key: id of servicePrincipal - /// key: id of federatedIdentityCredential + /// Search items by search phrases + /// Filter items by property values + /// Include count of items + /// Order items by property values /// Select properties to be returned /// Expand related entities /// 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 ServicePrincipalsGetFederatedIdentityCredentials_Validate(string servicePrincipalId, string federatedIdentityCredentialId, string[] Select, string[] Expand, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task ServicePrincipalsListAppRoleAssignments_Validate(string servicePrincipalId, string Search, string Filter, bool? Count, string[] Orderby, string[] Select, string[] Expand, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { await eventListener.AssertNotNull(nameof(servicePrincipalId),servicePrincipalId); - await eventListener.AssertNotNull(nameof(federatedIdentityCredentialId),federatedIdentityCredentialId); + await eventListener.AssertNotNull(nameof(Search),Search); + await eventListener.AssertNotNull(nameof(Filter),Filter); } } @@ -6769,6 +7470,178 @@ public partial class MSGraph } } + /// Update the navigation property appRoleAssignments in servicePrincipals + /// key: id of servicePrincipal + /// key: id of appRoleAssignment + /// New navigation property values + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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 ServicePrincipalsUpdateAppRoleAssignments(string servicePrincipalId, string appRoleAssignmentId, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRoleAssignment body, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode.IncludeUpdate) + { + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/servicePrincipals/" + + global::System.Uri.EscapeDataString(servicePrincipalId) + + "/appRoleAssignments/" + + global::System.Uri.EscapeDataString(appRoleAssignmentId) + + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://graph.microsoft.com/v1.0{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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.Resources.MSGraph.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ServicePrincipalsUpdateAppRoleAssignments_Call(request,onNoContent,onDefault,eventListener,sender); + } + } + + /// Update the navigation property appRoleAssignments in servicePrincipals + /// + /// New navigation property values + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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 ServicePrincipalsUpdateAppRoleAssignmentsViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRoleAssignment body, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode.IncludeUpdate) + { + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/servicePrincipals/(?[^/]+)/appRoleAssignments/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/servicePrincipals/{servicePrincipal-id}/appRoleAssignments/{appRoleAssignment-id}'"); + } + + // replace URI parameters with values from identity + var servicePrincipalId = _match.Groups["servicePrincipal-id"].Value; + var appRoleAssignmentId = _match.Groups["appRoleAssignment-id"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/servicePrincipals/" + + servicePrincipalId + + "/appRoleAssignments/" + + appRoleAssignmentId + + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://graph.microsoft.com/v1.0{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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.Resources.MSGraph.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ServicePrincipalsUpdateAppRoleAssignments_Call(request,onNoContent,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 default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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 ServicePrincipalsUpdateAppRoleAssignments_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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.Resources.MSGraph.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10Beta.OdataError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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. + /// + /// key: id of servicePrincipal + /// key: id of appRoleAssignment + /// New navigation property values + /// 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 ServicePrincipalsUpdateAppRoleAssignments_Validate(string servicePrincipalId, string appRoleAssignmentId, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRoleAssignment body, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(servicePrincipalId),servicePrincipalId); + await eventListener.AssertNotNull(nameof(appRoleAssignmentId),appRoleAssignmentId); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + /// /// Update the navigation property federatedIdentityCredentials in servicePrincipals /// diff --git a/src/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphAppRoleAssignment.cs b/src/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphAppRoleAssignment.cs index c55e5389a1ce..3bd4037ffb59 100644 --- a/src/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphAppRoleAssignment.cs +++ b/src/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphAppRoleAssignment.cs @@ -32,6 +32,7 @@ public partial class MicrosoftGraphAppRoleAssignment : /// is assigned to the resource app without any specific app roles. Required on create. /// [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.PropertyOrigin.Owned)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.FormatTable(Index = 1)] public string AppRoleId { get => this._appRoleId; set => this._appRoleId = value; } /// Backing field for property. @@ -42,17 +43,21 @@ public partial class MicrosoftGraphAppRoleAssignment : /// format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z. Read-only. /// [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.PropertyOrigin.Owned)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.FormatTable(Index = 4)] public global::System.DateTime? CreatedDateTime { get => this._createdDateTime; } [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.PropertyOrigin.Inherited)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.DoNotFormat] public global::System.DateTime? DeletedDateTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal)__microsoftGraphDirectoryObject).DeletedDateTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal)__microsoftGraphDirectoryObject).DeletedDateTime = value ?? default(global::System.DateTime); } /// The name displayed in directory [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.PropertyOrigin.Inherited)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.DoNotFormat] public string DisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal)__microsoftGraphDirectoryObject).DisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal)__microsoftGraphDirectoryObject).DisplayName = value ?? null; } /// Read-only. [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.PropertyOrigin.Inherited)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.FormatTable(Index = 0)] public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphEntityAutoGeneratedInternal)__microsoftGraphDirectoryObject).Id; } /// Internal Acessors for CreatedDateTime @@ -75,10 +80,12 @@ public partial class MicrosoftGraphAppRoleAssignment : /// The full id of object in directory [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.PropertyOrigin.Inherited)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.DoNotFormat] public string OdataId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal)__microsoftGraphDirectoryObject).OdataId; } /// The type of object in directory [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.PropertyOrigin.Inherited)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.DoNotFormat] public string OdataType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal)__microsoftGraphDirectoryObject).OdataType; } /// Backing field for property. @@ -89,6 +96,7 @@ public partial class MicrosoftGraphAppRoleAssignment : /// $filter (eq and startswith). /// [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.PropertyOrigin.Owned)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.FormatTable(Index = 2)] public string PrincipalDisplayName { get => this._principalDisplayName; } /// Backing field for property. @@ -98,6 +106,7 @@ public partial class MicrosoftGraphAppRoleAssignment : /// The unique identifier (id) for the user, group or service principal being granted the app role. Required on create. /// [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.PropertyOrigin.Owned)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.FormatTable(Index = 3)] public string PrincipalId { get => this._principalId; set => this._principalId = value; } /// Backing field for property. @@ -107,6 +116,7 @@ public partial class MicrosoftGraphAppRoleAssignment : /// The type of the assigned principal. This can either be User, Group or ServicePrincipal. Read-only. /// [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.PropertyOrigin.Owned)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.DoNotFormat] public string PrincipalType { get => this._principalType; } /// Backing field for property. @@ -116,6 +126,7 @@ public partial class MicrosoftGraphAppRoleAssignment : /// The display name of the resource app's service principal to which the assignment is made. /// [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.PropertyOrigin.Owned)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.DoNotFormat] public string ResourceDisplayName { get => this._resourceDisplayName; set => this._resourceDisplayName = value; } /// Backing field for property. @@ -126,6 +137,7 @@ public partial class MicrosoftGraphAppRoleAssignment : /// $filter (eq only). /// [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.PropertyOrigin.Owned)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.DoNotFormat] public string ResourceId { get => this._resourceId; set => this._resourceId = value; } /// Creates an new instance. diff --git a/src/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphAppRoleAssignmentCollectionResponse.PowerShell.cs b/src/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphAppRoleAssignmentCollectionResponse.PowerShell.cs new file mode 100644 index 000000000000..6005d3901d8c --- /dev/null +++ b/src/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphAppRoleAssignmentCollectionResponse.PowerShell.cs @@ -0,0 +1,181 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell; + + /// Collection of appRoleAssignment + [System.ComponentModel.TypeConverter(typeof(MicrosoftGraphAppRoleAssignmentCollectionResponseTypeConverter))] + public partial class MicrosoftGraphAppRoleAssignmentCollectionResponse + { + + /// + /// 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.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRoleAssignmentCollectionResponse DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MicrosoftGraphAppRoleAssignmentCollectionResponse(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.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRoleAssignmentCollectionResponse DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MicrosoftGraphAppRoleAssignmentCollectionResponse(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.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRoleAssignmentCollectionResponse FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MicrosoftGraphAppRoleAssignmentCollectionResponse(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.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRoleAssignmentCollectionResponseInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRoleAssignment[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRoleAssignmentCollectionResponseInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphAppRoleAssignmentTypeConverter.ConvertFrom)); + } + if (content.Contains("OdataNextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRoleAssignmentCollectionResponseInternal)this).OdataNextLink = (string) content.GetValueForProperty("OdataNextLink",((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRoleAssignmentCollectionResponseInternal)this).OdataNextLink, global::System.Convert.ToString); + } + // 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 MicrosoftGraphAppRoleAssignmentCollectionResponse(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.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRoleAssignmentCollectionResponseInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRoleAssignment[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRoleAssignmentCollectionResponseInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphAppRoleAssignmentTypeConverter.ConvertFrom)); + } + if (content.Contains("OdataNextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRoleAssignmentCollectionResponseInternal)this).OdataNextLink = (string) content.GetValueForProperty("OdataNextLink",((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRoleAssignmentCollectionResponseInternal)this).OdataNextLink, global::System.Convert.ToString); + } + // 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.Resources.MSGraph.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(); + } + } + /// Collection of appRoleAssignment + [System.ComponentModel.TypeConverter(typeof(MicrosoftGraphAppRoleAssignmentCollectionResponseTypeConverter))] + public partial interface IMicrosoftGraphAppRoleAssignmentCollectionResponse + + { + + } +} \ No newline at end of file diff --git a/src/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphAppRoleAssignmentCollectionResponse.TypeConverter.cs b/src/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphAppRoleAssignmentCollectionResponse.TypeConverter.cs new file mode 100644 index 000000000000..9479ab4df329 --- /dev/null +++ b/src/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphAppRoleAssignmentCollectionResponse.TypeConverter.cs @@ -0,0 +1,153 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MicrosoftGraphAppRoleAssignmentCollectionResponseTypeConverter : 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.Resources.MSGraph.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRoleAssignmentCollectionResponse ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRoleAssignmentCollectionResponse).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MicrosoftGraphAppRoleAssignmentCollectionResponse.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MicrosoftGraphAppRoleAssignmentCollectionResponse.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MicrosoftGraphAppRoleAssignmentCollectionResponse.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/src/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphAppRoleAssignmentCollectionResponse.cs b/src/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphAppRoleAssignmentCollectionResponse.cs new file mode 100644 index 000000000000..0c984f95dea6 --- /dev/null +++ b/src/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphAppRoleAssignmentCollectionResponse.cs @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Extensions; + + /// Collection of appRoleAssignment + public partial class MicrosoftGraphAppRoleAssignmentCollectionResponse : + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRoleAssignmentCollectionResponse, + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRoleAssignmentCollectionResponseInternal + { + + /// Backing field for property. + private string _odataNextLink; + + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.PropertyOrigin.Owned)] + public string OdataNextLink { get => this._odataNextLink; set => this._odataNextLink = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRoleAssignment[] _value; + + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRoleAssignment[] Value { get => this._value; set => this._value = value; } + + /// + /// Creates an new instance. + /// + public MicrosoftGraphAppRoleAssignmentCollectionResponse() + { + + } + } + /// Collection of appRoleAssignment + public partial interface IMicrosoftGraphAppRoleAssignmentCollectionResponse : + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IAssociativeArray + { + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"", + SerializedName = @"@odata.nextLink", + PossibleTypes = new [] { typeof(string) })] + string OdataNextLink { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRoleAssignment) })] + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRoleAssignment[] Value { get; set; } + + } + /// Collection of appRoleAssignment + internal partial interface IMicrosoftGraphAppRoleAssignmentCollectionResponseInternal + + { + string OdataNextLink { get; set; } + + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRoleAssignment[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/src/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphAppRoleAssignmentCollectionResponse.dictionary.cs b/src/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphAppRoleAssignmentCollectionResponse.dictionary.cs new file mode 100644 index 000000000000..b6588d85a0fa --- /dev/null +++ b/src/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphAppRoleAssignmentCollectionResponse.dictionary.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Extensions; + + public partial class MicrosoftGraphAppRoleAssignmentCollectionResponse : + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IAssociativeArray + { + protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); + + global::System.Collections.Generic.IDictionary Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IAssociativeArray.AdditionalProperties { get => __additionalProperties; } + + public global::System.Object this[global::System.String index] { get => __additionalProperties[index]; set => __additionalProperties[index] = value; } + + /// + /// + public void Add(global::System.String key, global::System.Object 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.Resources.MSGraph.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { "Value","OdataNextLink" } ) ) + { + 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.Resources.MSGraph.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { "Value","OdataNextLink" } ) ) + { + 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 global::System.Object value) => __additionalProperties.TryGetValue( key, out value); + + /// + + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphAppRoleAssignmentCollectionResponse source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/src/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphAppRoleAssignmentCollectionResponse.json.cs b/src/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphAppRoleAssignmentCollectionResponse.json.cs new file mode 100644 index 000000000000..619b1ce43296 --- /dev/null +++ b/src/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphAppRoleAssignmentCollectionResponse.json.cs @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Extensions; + + /// Collection of appRoleAssignment + public partial class MicrosoftGraphAppRoleAssignmentCollectionResponse + { + + /// + /// 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.Resources.MSGraph.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.Resources.MSGraph.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.Resources.MSGraph.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.Resources.MSGraph.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRoleAssignmentCollectionResponse. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRoleAssignmentCollectionResponse. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRoleAssignmentCollectionResponse FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonObject json ? new MicrosoftGraphAppRoleAssignmentCollectionResponse(json, new global::System.Collections.Generic.HashSet(){ @"value",@"@odata.nextLink" }) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonObject instance to deserialize from. + /// + internal MicrosoftGraphAppRoleAssignmentCollectionResponse(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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.Resources.MSGraph.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IAssociativeArray)this).AdditionalProperties, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.DeserializeDictionary(()=>new global::System.Collections.Generic.Dictionary()),exclusions ); + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRoleAssignment) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphAppRoleAssignment.FromJson(__u) )) ))() : null : Value;} + {_odataNextLink = If( json?.PropertyT("@odata.nextLink"), out var __jsonOdataNextLink) ? (string)__jsonOdataNextLink : (string)OdataNextLink;} + 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.Resources.MSGraph.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IAssociativeArray)this).AdditionalProperties, container); + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + AddIf( null != (((object)this._odataNextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonString(this._odataNextLink.ToString()) : null, "@odata.nextLink" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/src/Resources/MSGraph.Autorest/generated/api/Models/MSGraphIdentity.PowerShell.cs b/src/Resources/MSGraph.Autorest/generated/api/Models/MSGraphIdentity.PowerShell.cs index b4fde464d4f6..af8625f666bb 100644 --- a/src/Resources/MSGraph.Autorest/generated/api/Models/MSGraphIdentity.PowerShell.cs +++ b/src/Resources/MSGraph.Autorest/generated/api/Models/MSGraphIdentity.PowerShell.cs @@ -120,6 +120,10 @@ internal MSGraphIdentity(global::System.Collections.IDictionary content) { ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.IMSGraphIdentityInternal)this).ServicePrincipalId = (string) content.GetValueForProperty("ServicePrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.IMSGraphIdentityInternal)this).ServicePrincipalId, global::System.Convert.ToString); } + if (content.Contains("AppRoleAssignmentId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.IMSGraphIdentityInternal)this).AppRoleAssignmentId = (string) content.GetValueForProperty("AppRoleAssignmentId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.IMSGraphIdentityInternal)this).AppRoleAssignmentId, global::System.Convert.ToString); + } if (content.Contains("GroupId")) { ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.IMSGraphIdentityInternal)this).GroupId = (string) content.GetValueForProperty("GroupId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.IMSGraphIdentityInternal)this).GroupId, global::System.Convert.ToString); @@ -169,6 +173,10 @@ internal MSGraphIdentity(global::System.Management.Automation.PSObject content) { ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.IMSGraphIdentityInternal)this).ServicePrincipalId = (string) content.GetValueForProperty("ServicePrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.IMSGraphIdentityInternal)this).ServicePrincipalId, global::System.Convert.ToString); } + if (content.Contains("AppRoleAssignmentId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.IMSGraphIdentityInternal)this).AppRoleAssignmentId = (string) content.GetValueForProperty("AppRoleAssignmentId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.IMSGraphIdentityInternal)this).AppRoleAssignmentId, global::System.Convert.ToString); + } if (content.Contains("GroupId")) { ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.IMSGraphIdentityInternal)this).GroupId = (string) content.GetValueForProperty("GroupId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.IMSGraphIdentityInternal)this).GroupId, global::System.Convert.ToString); diff --git a/src/Resources/MSGraph.Autorest/generated/api/Models/MSGraphIdentity.cs b/src/Resources/MSGraph.Autorest/generated/api/Models/MSGraphIdentity.cs index bac8bc864e21..956696d64fbd 100644 --- a/src/Resources/MSGraph.Autorest/generated/api/Models/MSGraphIdentity.cs +++ b/src/Resources/MSGraph.Autorest/generated/api/Models/MSGraphIdentity.cs @@ -12,6 +12,13 @@ public partial class MSGraphIdentity : Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.IMSGraphIdentityInternal { + /// Backing field for property. + private string _appRoleAssignmentId; + + /// key: id of appRoleAssignment + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.PropertyOrigin.Owned)] + public string AppRoleAssignmentId { get => this._appRoleAssignmentId; set => this._appRoleAssignmentId = value; } + /// Backing field for property. private string _applicationId; @@ -77,6 +84,17 @@ public MSGraphIdentity() public partial interface IMSGraphIdentity : Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IJsonSerializable { + /// key: id of appRoleAssignment + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"key: id of appRoleAssignment", + SerializedName = @"appRoleAssignment-id", + PossibleTypes = new [] { typeof(string) })] + string AppRoleAssignmentId { get; set; } /// key: id of application [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Info( Required = false, @@ -170,6 +188,8 @@ public partial interface IMSGraphIdentity : internal partial interface IMSGraphIdentityInternal { + /// key: id of appRoleAssignment + string AppRoleAssignmentId { get; set; } /// key: id of application string ApplicationId { get; set; } /// The unique identifier of directoryObject diff --git a/src/Resources/MSGraph.Autorest/generated/api/Models/MSGraphIdentity.json.cs b/src/Resources/MSGraph.Autorest/generated/api/Models/MSGraphIdentity.json.cs index 19ec0def0408..344b9d16de7f 100644 --- a/src/Resources/MSGraph.Autorest/generated/api/Models/MSGraphIdentity.json.cs +++ b/src/Resources/MSGraph.Autorest/generated/api/Models/MSGraphIdentity.json.cs @@ -79,6 +79,7 @@ internal MSGraphIdentity(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Ru {_applicationId = If( json?.PropertyT("application-id"), out var __jsonApplicationId) ? (string)__jsonApplicationId : (string)ApplicationId;} {_federatedIdentityCredentialId = If( json?.PropertyT("federatedIdentityCredential-id"), out var __jsonFederatedIdentityCredentialId) ? (string)__jsonFederatedIdentityCredentialId : (string)FederatedIdentityCredentialId;} {_servicePrincipalId = If( json?.PropertyT("servicePrincipal-id"), out var __jsonServicePrincipalId) ? (string)__jsonServicePrincipalId : (string)ServicePrincipalId;} + {_appRoleAssignmentId = If( json?.PropertyT("appRoleAssignment-id"), out var __jsonAppRoleAssignmentId) ? (string)__jsonAppRoleAssignmentId : (string)AppRoleAssignmentId;} {_groupId = If( json?.PropertyT("group-id"), out var __jsonGroupId) ? (string)__jsonGroupId : (string)GroupId;} {_directoryObjectId = If( json?.PropertyT("directoryObject-id"), out var __jsonDirectoryObjectId) ? (string)__jsonDirectoryObjectId : (string)DirectoryObjectId;} {_memberId = If( json?.PropertyT("member-id"), out var __jsonMemberId) ? (string)__jsonMemberId : (string)MemberId;} @@ -109,6 +110,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNod AddIf( null != (((object)this._applicationId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonString(this._applicationId.ToString()) : null, "application-id" ,container.Add ); AddIf( null != (((object)this._federatedIdentityCredentialId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonString(this._federatedIdentityCredentialId.ToString()) : null, "federatedIdentityCredential-id" ,container.Add ); AddIf( null != (((object)this._servicePrincipalId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonString(this._servicePrincipalId.ToString()) : null, "servicePrincipal-id" ,container.Add ); + AddIf( null != (((object)this._appRoleAssignmentId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonString(this._appRoleAssignmentId.ToString()) : null, "appRoleAssignment-id" ,container.Add ); AddIf( null != (((object)this._groupId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonString(this._groupId.ToString()) : null, "group-id" ,container.Add ); AddIf( null != (((object)this._directoryObjectId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonString(this._directoryObjectId.ToString()) : null, "directoryObject-id" ,container.Add ); AddIf( null != (((object)this._memberId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonString(this._memberId.ToString()) : null, "member-id" ,container.Add ); diff --git a/src/Resources/MSGraph.Autorest/generated/cmdlets/GetAzADServicePrincipalAppRoleAssignment_Get.cs b/src/Resources/MSGraph.Autorest/generated/cmdlets/GetAzADServicePrincipalAppRoleAssignment_Get.cs new file mode 100644 index 000000000000..45727ce6e909 --- /dev/null +++ b/src/Resources/MSGraph.Autorest/generated/cmdlets/GetAzADServicePrincipalAppRoleAssignment_Get.cs @@ -0,0 +1,449 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Cmdlets; + using System; + + /// Get appRoleAssignments from servicePrincipals + /// + /// [OpenAPI] GetAppRoleAssignments=>GET:"/servicePrincipals/{servicePrincipal-id}/appRoleAssignments/{appRoleAssignment-id}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzADServicePrincipalAppRoleAssignment_Get")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRoleAssignment))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Description(@"Get appRoleAssignments from servicePrincipals")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.HttpPath(Path = "/servicePrincipals/{servicePrincipal-id}/appRoleAssignments/{appRoleAssignment-id}", ApiVersion = "v1.0")] + public partial class GetAzADServicePrincipalAppRoleAssignment_Get : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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(); + + /// Backing field for property. + private string _appRoleAssignmentId; + + /// key: id of appRoleAssignment + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "key: id of appRoleAssignment")] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"key: id of appRoleAssignment", + SerializedName = @"appRoleAssignment-id", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Path)] + public string AppRoleAssignmentId { get => this._appRoleAssignmentId; set => this._appRoleAssignmentId = value; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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.Resources.MSGraph.MSGraph Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string[] _expand; + + /// Expand related entities + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Expand related entities")] + [global::System.Management.Automation.AllowEmptyCollection] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Expand related entities", + SerializedName = @"$expand", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Query)] + public string[] Expand { get => this._expand; set => this._expand = value; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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.Resources.MSGraph.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string[] _select; + + /// Select properties to be returned + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Select properties to be returned")] + [global::System.Management.Automation.AllowEmptyCollection] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Select properties to be returned", + SerializedName = @"$select", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Query)] + public string[] Select { get => this._select; set => this._select = value; } + + /// Backing field for property. + private string _servicePrincipalId; + + /// key: id of servicePrincipal + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "key: id of servicePrincipal")] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"key: id of servicePrincipal", + SerializedName = @"servicePrincipal-id", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Path)] + public string ServicePrincipalId { get => this._servicePrincipalId; set => this._servicePrincipalId = 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.Resources.MSGraph.Models.ApiV10Beta.IOdataError + /// 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.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRoleAssignment + /// 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.Resources.MSGraph.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzADServicePrincipalAppRoleAssignment_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.Resources.MSGraph.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.Resources.MSGraph.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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.Resources.MSGraph.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.Resources.MSGraph.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ServicePrincipalsGetAppRoleAssignments(ServicePrincipalId, AppRoleAssignmentId, this.InvocationInformation.BoundParameters.ContainsKey("Select") ? Select : null /* arrayOf */, this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null /* arrayOf */, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ServicePrincipalId=ServicePrincipalId,AppRoleAssignmentId=AppRoleAssignmentId,Select=this.InvocationInformation.BoundParameters.ContainsKey("Select") ? Select : null /* arrayOf */,Expand=this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null /* arrayOf */}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10Beta.IOdataError + /// 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)?.Error?.Code; + var message = (await response)?.Error?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ServicePrincipalId=ServicePrincipalId, AppRoleAssignmentId=AppRoleAssignmentId, Select=this.InvocationInformation.BoundParameters.ContainsKey("Select") ? Select : null /* arrayOf */, Expand=this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null /* arrayOf */ }) + { + 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 { ServicePrincipalId=ServicePrincipalId, AppRoleAssignmentId=AppRoleAssignmentId, Select=this.InvocationInformation.BoundParameters.ContainsKey("Select") ? Select : null /* arrayOf */, Expand=this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null /* arrayOf */ }) + { + 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.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRoleAssignment + /// 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.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRoleAssignment + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/src/Resources/MSGraph.Autorest/generated/cmdlets/GetAzADServicePrincipalAppRoleAssignment_List.cs b/src/Resources/MSGraph.Autorest/generated/cmdlets/GetAzADServicePrincipalAppRoleAssignment_List.cs new file mode 100644 index 000000000000..a2d8a3a27d1e --- /dev/null +++ b/src/Resources/MSGraph.Autorest/generated/cmdlets/GetAzADServicePrincipalAppRoleAssignment_List.cs @@ -0,0 +1,526 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Cmdlets; + using System; + + /// Get appRoleAssignments from servicePrincipals + /// + /// [OpenAPI] ListAppRoleAssignments=>GET:"/servicePrincipals/{servicePrincipal-id}/appRoleAssignments" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzADServicePrincipalAppRoleAssignment_List", SupportsPaging = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRoleAssignment))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Description(@"Get appRoleAssignments from servicePrincipals")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.HttpPath(Path = "/servicePrincipals/{servicePrincipal-id}/appRoleAssignments", ApiVersion = "v1.0")] + public partial class GetAzADServicePrincipalAppRoleAssignment_List : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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 flag to tell whether it is the first onOK call. + private bool _isFirst = true; + + /// Link to retrieve next page. + private string _nextLink; + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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.Resources.MSGraph.MSGraph Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.ClientAPI; + + /// Backing field for property. + private global::System.Management.Automation.SwitchParameter _count; + + /// Include count of items + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Include count of items")] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Include count of items", + SerializedName = @"$count", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Query)] + public global::System.Management.Automation.SwitchParameter Count { get => this._count; set => this._count = value; } + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string[] _expand; + + /// Expand related entities + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Expand related entities")] + [global::System.Management.Automation.AllowEmptyCollection] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Expand related entities", + SerializedName = @"$expand", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Query)] + public string[] Expand { get => this._expand; set => this._expand = value; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// Backing field for property. + private string _filter; + + /// Filter items by property values + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Filter items by property values")] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Filter items by property values", + SerializedName = @"$filter", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Query)] + public string Filter { get => this._filter; set => this._filter = value; } + + /// 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.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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.Resources.MSGraph.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string[] _orderby; + + /// Order items by property values + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Order items by property values")] + [global::System.Management.Automation.AllowEmptyCollection] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Order items by property values", + SerializedName = @"$orderby", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Query)] + public string[] Orderby { get => this._orderby; set => this._orderby = value; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _search; + + /// Search items by search phrases + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Search items by search phrases")] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Search items by search phrases", + SerializedName = @"$search", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Query)] + public string Search { get => this._search; set => this._search = value; } + + /// Backing field for property. + private string[] _select; + + /// Select properties to be returned + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Select properties to be returned")] + [global::System.Management.Automation.AllowEmptyCollection] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Select properties to be returned", + SerializedName = @"$select", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Query)] + public string[] Select { get => this._select; set => this._select = value; } + + /// Backing field for property. + private string _servicePrincipalId; + + /// key: id of servicePrincipal + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "key: id of servicePrincipal")] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"key: id of servicePrincipal", + SerializedName = @"servicePrincipal-id", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Path)] + public string ServicePrincipalId { get => this._servicePrincipalId; set => this._servicePrincipalId = 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.Resources.MSGraph.Models.ApiV10Beta.IOdataError + /// 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.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRoleAssignmentCollectionResponse + /// 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.Resources.MSGraph.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzADServicePrincipalAppRoleAssignment_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.Resources.MSGraph.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.Resources.MSGraph.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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.Resources.MSGraph.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.Resources.MSGraph.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ServicePrincipalsListAppRoleAssignments(ServicePrincipalId, this.InvocationInformation.BoundParameters.ContainsKey("Search") ? Search : null, this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, this.InvocationInformation.BoundParameters.ContainsKey("Count") ? Count : default(global::System.Management.Automation.SwitchParameter?), this.InvocationInformation.BoundParameters.ContainsKey("Orderby") ? Orderby : null /* arrayOf */, this.InvocationInformation.BoundParameters.ContainsKey("Select") ? Select : null /* arrayOf */, this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null /* arrayOf */, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ServicePrincipalId=ServicePrincipalId,Search=this.InvocationInformation.BoundParameters.ContainsKey("Search") ? Search : null,Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null,Count=this.InvocationInformation.BoundParameters.ContainsKey("Count") ? Count : default(global::System.Management.Automation.SwitchParameter?),Orderby=this.InvocationInformation.BoundParameters.ContainsKey("Orderby") ? Orderby : null /* arrayOf */,Select=this.InvocationInformation.BoundParameters.ContainsKey("Select") ? Select : null /* arrayOf */,Expand=this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null /* arrayOf */}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10Beta.IOdataError + /// 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)?.Error?.Code; + var message = (await response)?.Error?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ServicePrincipalId=ServicePrincipalId, Search=this.InvocationInformation.BoundParameters.ContainsKey("Search") ? Search : null, Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, Count=this.InvocationInformation.BoundParameters.ContainsKey("Count") ? Count : default(global::System.Management.Automation.SwitchParameter?), Orderby=this.InvocationInformation.BoundParameters.ContainsKey("Orderby") ? Orderby : null /* arrayOf */, Select=this.InvocationInformation.BoundParameters.ContainsKey("Select") ? Select : null /* arrayOf */, Expand=this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null /* arrayOf */ }) + { + 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 { ServicePrincipalId=ServicePrincipalId, Search=this.InvocationInformation.BoundParameters.ContainsKey("Search") ? Search : null, Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, Count=this.InvocationInformation.BoundParameters.ContainsKey("Count") ? Count : default(global::System.Management.Automation.SwitchParameter?), Orderby=this.InvocationInformation.BoundParameters.ContainsKey("Orderby") ? Orderby : null /* arrayOf */, Select=this.InvocationInformation.BoundParameters.ContainsKey("Select") ? Select : null /* arrayOf */, Expand=this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null /* arrayOf */ }) + { + 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.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRoleAssignmentCollectionResponse + /// 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 + // clientside pagination enabled + // response should be returning an array of some kind. +Pageable + // pageable / value / @odata.nextLink + var result = await response; + if ((ulong)result.Value.Length <= this.PagingParameters.Skip) + { + this.PagingParameters.Skip = this.PagingParameters.Skip - (ulong)result.Value.Length; + } + else + { + ulong toRead = Math.Min(this.PagingParameters.First, (ulong)result.Value.Length - this.PagingParameters.Skip); + var requiredResult = result.Value.SubArray((int)this.PagingParameters.Skip, (int)toRead); + WriteObject(requiredResult, true); + this.PagingParameters.Skip = 0; + this.PagingParameters.First = this.PagingParameters.First <= toRead ? 0 : this.PagingParameters.First - toRead; + } + _nextLink = result.OdataNextLink; + if (_isFirst) + { + _isFirst = false; + while (_nextLink != null && this.PagingParameters.First > 0) + { + if (responseMessage.RequestMessage is System.Net.Http.HttpRequestMessage requestMessage ) + { + requestMessage = requestMessage.Clone(new global::System.Uri( _nextLink ),Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Get ); + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.FollowingNextLink); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ServicePrincipalsListAppRoleAssignments_Call(requestMessage, onOk, onDefault, this, Pipeline); + } + } + } + } + } + } +} \ No newline at end of file diff --git a/src/Resources/MSGraph.Autorest/generated/cmdlets/NewAzADServicePrincipalAppRoleAssignment_Create.cs b/src/Resources/MSGraph.Autorest/generated/cmdlets/NewAzADServicePrincipalAppRoleAssignment_Create.cs new file mode 100644 index 000000000000..b44513dde080 --- /dev/null +++ b/src/Resources/MSGraph.Autorest/generated/cmdlets/NewAzADServicePrincipalAppRoleAssignment_Create.cs @@ -0,0 +1,426 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Cmdlets; + using System; + + /// Create new navigation property to appRoleAssignments for servicePrincipals + /// + /// [OpenAPI] CreateAppRoleAssignments=>POST:"/servicePrincipals/{servicePrincipal-id}/appRoleAssignments" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzADServicePrincipalAppRoleAssignment_Create", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRoleAssignment))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Description(@"Create new navigation property to appRoleAssignments for servicePrincipals")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.HttpPath(Path = "/servicePrincipals/{servicePrincipal-id}/appRoleAssignments", ApiVersion = "v1.0")] + public partial class NewAzADServicePrincipalAppRoleAssignment_Create : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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(); + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRoleAssignment _body; + + /// + /// Represents an Azure Active Directory object. The directoryObject type is the base type for many other directory entity + /// types. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Represents an Azure Active Directory object. The directoryObject type is the base type for many other directory entity types.", ValueFromPipeline = true)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Represents an Azure Active Directory object. The directoryObject type is the base type for many other directory entity types.", + SerializedName = @"body", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRoleAssignment) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Body)] + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRoleAssignment Body { get => this._body; set => this._body = value; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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.Resources.MSGraph.MSGraph Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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.Resources.MSGraph.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _servicePrincipalId; + + /// key: id of servicePrincipal + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "key: id of servicePrincipal")] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"key: id of servicePrincipal", + SerializedName = @"servicePrincipal-id", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Path)] + public string ServicePrincipalId { get => this._servicePrincipalId; set => this._servicePrincipalId = value; } + + /// + /// overrideOnCreated will be called before the regular onCreated 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.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRoleAssignment + /// from the remote call + /// /// Determines if the rest of the onCreated method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnCreated(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// 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.Resources.MSGraph.Models.ApiV10Beta.IOdataError + /// 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); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// 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.Resources.MSGraph.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.Resources.MSGraph.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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.Resources.MSGraph.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.Resources.MSGraph.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public NewAzADServicePrincipalAppRoleAssignment_Create() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ServicePrincipalsCreateAppRoleAssignments' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ServicePrincipalsCreateAppRoleAssignments(ServicePrincipalId, Body, onCreated, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ServicePrincipalId=ServicePrincipalId,body=Body}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// a delegate that is called when the remote service returns 201 (Created). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRoleAssignment + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onCreated(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnCreated(responseMessage, response, ref _returnNow); + // if overrideOnCreated has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onCreated - response for 201 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRoleAssignment + WriteObject((await response)); + } + } + + /// + /// 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.Resources.MSGraph.Models.ApiV10Beta.IOdataError + /// 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)?.Error?.Code; + var message = (await response)?.Error?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ServicePrincipalId=ServicePrincipalId, body=Body }) + { + 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 { ServicePrincipalId=ServicePrincipalId, body=Body }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + } +} \ No newline at end of file diff --git a/src/Resources/MSGraph.Autorest/generated/cmdlets/NewAzADServicePrincipalAppRoleAssignment_CreateExpanded.cs b/src/Resources/MSGraph.Autorest/generated/cmdlets/NewAzADServicePrincipalAppRoleAssignment_CreateExpanded.cs new file mode 100644 index 000000000000..49b708bad89c --- /dev/null +++ b/src/Resources/MSGraph.Autorest/generated/cmdlets/NewAzADServicePrincipalAppRoleAssignment_CreateExpanded.cs @@ -0,0 +1,502 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Cmdlets; + using System; + + /// Create new navigation property to appRoleAssignments for servicePrincipals + /// + /// [OpenAPI] CreateAppRoleAssignments=>POST:"/servicePrincipals/{servicePrincipal-id}/appRoleAssignments" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzADServicePrincipalAppRoleAssignment_CreateExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRoleAssignment))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Description(@"Create new navigation property to appRoleAssignments for servicePrincipals")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.HttpPath(Path = "/servicePrincipals/{servicePrincipal-id}/appRoleAssignments", ApiVersion = "v1.0")] + public partial class NewAzADServicePrincipalAppRoleAssignment_CreateExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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; + + /// + /// Represents an Azure Active Directory object. The directoryObject type is the base type for many other directory entity + /// types. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRoleAssignment _body = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphAppRoleAssignment(); + + /// + /// 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(); + + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Additional Parameters")] + public global::System.Collections.Hashtable AdditionalProperties { get; set; } + + /// + /// The identifier (id) for the app role which is assigned to the principal. This app role must be exposed in the appRoles + /// property on the resource application's service principal (resourceId). If the resource application has not declared any + /// app roles, a default app role ID of 00000000-0000-0000-0000-000000000000 can be specified to signal that the principal + /// is assigned to the resource app without any specific app roles. Required on create. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The identifier (id) for the app role which is assigned to the principal. This app role must be exposed in the appRoles property on the resource application's service principal (resourceId). If the resource application has not declared any app roles, a default app role ID of 00000000-0000-0000-0000-000000000000 can be specified to signal that the principal is assigned to the resource app without any specific app roles. Required on create.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The identifier (id) for the app role which is assigned to the principal. This app role must be exposed in the appRoles property on the resource application's service principal (resourceId). If the resource application has not declared any app roles, a default app role ID of 00000000-0000-0000-0000-000000000000 can be specified to signal that the principal is assigned to the resource app without any specific app roles. Required on create.", + SerializedName = @"appRoleId", + PossibleTypes = new [] { typeof(string) })] + public string AppRoleId { get => _body.AppRoleId ?? null; set => _body.AppRoleId = value; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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.Resources.MSGraph.MSGraph Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// . + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = ".")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @".", + SerializedName = @"deletedDateTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.DoNotExport] + public global::System.DateTime DeletedDateTime { get => _body.DeletedDateTime ?? default(global::System.DateTime); set => _body.DeletedDateTime = value; } + + /// The name displayed in directory + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The name displayed in directory")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The name displayed in directory", + SerializedName = @"displayName", + PossibleTypes = new [] { typeof(string) })] + public string DisplayName { get => _body.DisplayName ?? null; set => _body.DisplayName = value; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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.Resources.MSGraph.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.HttpPipeline Pipeline { get; set; } + + /// + /// The unique identifier (id) for the user, group or service principal being granted the app role. Required on create. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The unique identifier (id) for the user, group or service principal being granted the app role. Required on create.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The unique identifier (id) for the user, group or service principal being granted the app role. Required on create.", + SerializedName = @"principalId", + PossibleTypes = new [] { typeof(string) })] + public string PrincipalId { get => _body.PrincipalId ?? null; set => _body.PrincipalId = 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.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// The display name of the resource app's service principal to which the assignment is made. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The display name of the resource app's service principal to which the assignment is made.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The display name of the resource app's service principal to which the assignment is made.", + SerializedName = @"resourceDisplayName", + PossibleTypes = new [] { typeof(string) })] + public string ResourceDisplayName { get => _body.ResourceDisplayName ?? null; set => _body.ResourceDisplayName = value; } + + /// + /// The unique identifier (id) for the resource service principal for which the assignment is made. Required on create. Supports + /// $filter (eq only). + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The unique identifier (id) for the resource service principal for which the assignment is made. Required on create. Supports $filter (eq only).")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The unique identifier (id) for the resource service principal for which the assignment is made. Required on create. Supports $filter (eq only).", + SerializedName = @"resourceId", + PossibleTypes = new [] { typeof(string) })] + public string ResourceId { get => _body.ResourceId ?? null; set => _body.ResourceId = value; } + + /// Backing field for property. + private string _servicePrincipalId; + + /// key: id of servicePrincipal + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "key: id of servicePrincipal")] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"key: id of servicePrincipal", + SerializedName = @"servicePrincipal-id", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Path)] + public string ServicePrincipalId { get => this._servicePrincipalId; set => this._servicePrincipalId = value; } + + /// + /// overrideOnCreated will be called before the regular onCreated 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.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRoleAssignment + /// from the remote call + /// /// Determines if the rest of the onCreated method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnCreated(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// 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.Resources.MSGraph.Models.ApiV10Beta.IOdataError + /// 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); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// 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.Resources.MSGraph.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.Resources.MSGraph.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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.Resources.MSGraph.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.Resources.MSGraph.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public NewAzADServicePrincipalAppRoleAssignment_CreateExpanded() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ServicePrincipalsCreateAppRoleAssignments' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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 ) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.DictionaryExtensions.HashTableToDictionary(AdditionalProperties,_body.AdditionalProperties); + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + if (true == this.MyInvocation?.BoundParameters?.ContainsKey("DeletedDateTime")) + { + DeletedDateTime = (global::System.DateTime)this.MyInvocation.BoundParameters["DeletedDateTime"]; + } + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ServicePrincipalsCreateAppRoleAssignments(ServicePrincipalId, _body, onCreated, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ServicePrincipalId=ServicePrincipalId,body=_body}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// a delegate that is called when the remote service returns 201 (Created). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRoleAssignment + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onCreated(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnCreated(responseMessage, response, ref _returnNow); + // if overrideOnCreated has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onCreated - response for 201 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRoleAssignment + WriteObject((await response)); + } + } + + /// + /// 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.Resources.MSGraph.Models.ApiV10Beta.IOdataError + /// 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)?.Error?.Code; + var message = (await response)?.Error?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ServicePrincipalId=ServicePrincipalId, body=_body }) + { + 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 { ServicePrincipalId=ServicePrincipalId, body=_body }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + } +} \ No newline at end of file diff --git a/src/Resources/MSGraph.Autorest/generated/cmdlets/RemoveAzADServicePrincipalAppRoleAssignment_Delete.cs b/src/Resources/MSGraph.Autorest/generated/cmdlets/RemoveAzADServicePrincipalAppRoleAssignment_Delete.cs new file mode 100644 index 000000000000..c877761402af --- /dev/null +++ b/src/Resources/MSGraph.Autorest/generated/cmdlets/RemoveAzADServicePrincipalAppRoleAssignment_Delete.cs @@ -0,0 +1,441 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Cmdlets; + using System; + + /// Delete navigation property appRoleAssignments for servicePrincipals + /// + /// [OpenAPI] DeleteAppRoleAssignments=>DELETE:"/servicePrincipals/{servicePrincipal-id}/appRoleAssignments/{appRoleAssignment-id}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzADServicePrincipalAppRoleAssignment_Delete", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Description(@"Delete navigation property appRoleAssignments for servicePrincipals")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.HttpPath(Path = "/servicePrincipals/{servicePrincipal-id}/appRoleAssignments/{appRoleAssignment-id}", ApiVersion = "v1.0")] + public partial class RemoveAzADServicePrincipalAppRoleAssignment_Delete : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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(); + + /// Backing field for property. + private string _appRoleAssignmentId; + + /// key: id of appRoleAssignment + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "key: id of appRoleAssignment")] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"key: id of appRoleAssignment", + SerializedName = @"appRoleAssignment-id", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Path)] + public string AppRoleAssignmentId { get => this._appRoleAssignmentId; set => this._appRoleAssignmentId = value; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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.Resources.MSGraph.MSGraph Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private string _ifMatch; + + /// ETag + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "ETag")] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"ETag", + SerializedName = @"If-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Header)] + public string IfMatch { get => this._ifMatch; set => this._ifMatch = 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.Resources.MSGraph.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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.Resources.MSGraph.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.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _servicePrincipalId; + + /// key: id of servicePrincipal + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "key: id of servicePrincipal")] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"key: id of servicePrincipal", + SerializedName = @"servicePrincipal-id", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Path)] + public string ServicePrincipalId { get => this._servicePrincipalId; set => this._servicePrincipalId = 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.Resources.MSGraph.Models.ApiV10Beta.IOdataError + /// 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); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// 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.Resources.MSGraph.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.Resources.MSGraph.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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.Resources.MSGraph.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.Resources.MSGraph.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ServicePrincipalsDeleteAppRoleAssignments' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ServicePrincipalsDeleteAppRoleAssignments(ServicePrincipalId, AppRoleAssignmentId, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, onNoContent, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ServicePrincipalId=ServicePrincipalId,AppRoleAssignmentId=AppRoleAssignmentId,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public RemoveAzADServicePrincipalAppRoleAssignment_Delete() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10Beta.IOdataError + /// 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)?.Error?.Code; + var message = (await response)?.Error?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ServicePrincipalId=ServicePrincipalId, AppRoleAssignmentId=AppRoleAssignmentId, IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null }) + { + 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 { ServicePrincipalId=ServicePrincipalId, AppRoleAssignmentId=AppRoleAssignmentId, IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/src/Resources/MSGraph.Autorest/generated/cmdlets/UpdateAzADServicePrincipalAppRoleAssignment_Update.cs b/src/Resources/MSGraph.Autorest/generated/cmdlets/UpdateAzADServicePrincipalAppRoleAssignment_Update.cs new file mode 100644 index 000000000000..5d8f3a900745 --- /dev/null +++ b/src/Resources/MSGraph.Autorest/generated/cmdlets/UpdateAzADServicePrincipalAppRoleAssignment_Update.cs @@ -0,0 +1,444 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Cmdlets; + using System; + + /// Update the navigation property appRoleAssignments in servicePrincipals + /// + /// [OpenAPI] UpdateAppRoleAssignments=>PATCH:"/servicePrincipals/{servicePrincipal-id}/appRoleAssignments/{appRoleAssignment-id}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzADServicePrincipalAppRoleAssignment_Update", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Description(@"Update the navigation property appRoleAssignments in servicePrincipals")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.HttpPath(Path = "/servicePrincipals/{servicePrincipal-id}/appRoleAssignments/{appRoleAssignment-id}", ApiVersion = "v1.0")] + public partial class UpdateAzADServicePrincipalAppRoleAssignment_Update : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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(); + + /// Backing field for property. + private string _appRoleAssignmentId; + + /// key: id of appRoleAssignment + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "key: id of appRoleAssignment")] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"key: id of appRoleAssignment", + SerializedName = @"appRoleAssignment-id", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Path)] + public string AppRoleAssignmentId { get => this._appRoleAssignmentId; set => this._appRoleAssignmentId = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRoleAssignment _body; + + /// + /// Represents an Azure Active Directory object. The directoryObject type is the base type for many other directory entity + /// types. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Represents an Azure Active Directory object. The directoryObject type is the base type for many other directory entity types.", ValueFromPipeline = true)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Represents an Azure Active Directory object. The directoryObject type is the base type for many other directory entity types.", + SerializedName = @"body", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRoleAssignment) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Body)] + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRoleAssignment Body { get => this._body; set => this._body = value; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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.Resources.MSGraph.MSGraph Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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.Resources.MSGraph.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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.Resources.MSGraph.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.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _servicePrincipalId; + + /// key: id of servicePrincipal + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "key: id of servicePrincipal")] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"key: id of servicePrincipal", + SerializedName = @"servicePrincipal-id", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Path)] + public string ServicePrincipalId { get => this._servicePrincipalId; set => this._servicePrincipalId = 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.Resources.MSGraph.Models.ApiV10Beta.IOdataError + /// 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); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// 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.Resources.MSGraph.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.Resources.MSGraph.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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.Resources.MSGraph.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.Resources.MSGraph.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ServicePrincipalsUpdateAppRoleAssignments' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ServicePrincipalsUpdateAppRoleAssignments(ServicePrincipalId, AppRoleAssignmentId, Body, onNoContent, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode.IncludeUpdate); + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ServicePrincipalId=ServicePrincipalId,AppRoleAssignmentId=AppRoleAssignmentId,body=Body}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public UpdateAzADServicePrincipalAppRoleAssignment_Update() + { + + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10Beta.IOdataError + /// 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)?.Error?.Code; + var message = (await response)?.Error?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ServicePrincipalId=ServicePrincipalId, AppRoleAssignmentId=AppRoleAssignmentId, body=Body }) + { + 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 { ServicePrincipalId=ServicePrincipalId, AppRoleAssignmentId=AppRoleAssignmentId, body=Body }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/src/Resources/MSGraph.Autorest/generated/cmdlets/UpdateAzADServicePrincipalAppRoleAssignment_UpdateExpanded.cs b/src/Resources/MSGraph.Autorest/generated/cmdlets/UpdateAzADServicePrincipalAppRoleAssignment_UpdateExpanded.cs new file mode 100644 index 000000000000..be6f1fed61a1 --- /dev/null +++ b/src/Resources/MSGraph.Autorest/generated/cmdlets/UpdateAzADServicePrincipalAppRoleAssignment_UpdateExpanded.cs @@ -0,0 +1,540 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Cmdlets; + using System; + + /// Update the navigation property appRoleAssignments in servicePrincipals + /// + /// [OpenAPI] UpdateAppRoleAssignments=>PATCH:"/servicePrincipals/{servicePrincipal-id}/appRoleAssignments/{appRoleAssignment-id}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzADServicePrincipalAppRoleAssignment_UpdateExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Description(@"Update the navigation property appRoleAssignments in servicePrincipals")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.HttpPath(Path = "/servicePrincipals/{servicePrincipal-id}/appRoleAssignments/{appRoleAssignment-id}", ApiVersion = "v1.0")] + public partial class UpdateAzADServicePrincipalAppRoleAssignment_UpdateExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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; + + /// + /// Represents an Azure Active Directory object. The directoryObject type is the base type for many other directory entity + /// types. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRoleAssignment _body = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphAppRoleAssignment(); + + /// + /// 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(); + + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Additional Parameters")] + public global::System.Collections.Hashtable AdditionalProperties { get; set; } + + /// Backing field for property. + private string _appRoleAssignmentId; + + /// key: id of appRoleAssignment + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "key: id of appRoleAssignment")] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"key: id of appRoleAssignment", + SerializedName = @"appRoleAssignment-id", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Path)] + public string AppRoleAssignmentId { get => this._appRoleAssignmentId; set => this._appRoleAssignmentId = value; } + + /// + /// The identifier (id) for the app role which is assigned to the principal. This app role must be exposed in the appRoles + /// property on the resource application's service principal (resourceId). If the resource application has not declared any + /// app roles, a default app role ID of 00000000-0000-0000-0000-000000000000 can be specified to signal that the principal + /// is assigned to the resource app without any specific app roles. Required on create. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The identifier (id) for the app role which is assigned to the principal. This app role must be exposed in the appRoles property on the resource application's service principal (resourceId). If the resource application has not declared any app roles, a default app role ID of 00000000-0000-0000-0000-000000000000 can be specified to signal that the principal is assigned to the resource app without any specific app roles. Required on create.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The identifier (id) for the app role which is assigned to the principal. This app role must be exposed in the appRoles property on the resource application's service principal (resourceId). If the resource application has not declared any app roles, a default app role ID of 00000000-0000-0000-0000-000000000000 can be specified to signal that the principal is assigned to the resource app without any specific app roles. Required on create.", + SerializedName = @"appRoleId", + PossibleTypes = new [] { typeof(string) })] + public string AppRoleId { get => _body.AppRoleId ?? null; set => _body.AppRoleId = value; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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.Resources.MSGraph.MSGraph Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// . + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = ".")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @".", + SerializedName = @"deletedDateTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.DoNotExport] + public global::System.DateTime DeletedDateTime { get => _body.DeletedDateTime ?? default(global::System.DateTime); set => _body.DeletedDateTime = value; } + + /// The name displayed in directory + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The name displayed in directory")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The name displayed in directory", + SerializedName = @"displayName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.DoNotExport] + public string DisplayName { get => _body.DisplayName ?? null; set => _body.DisplayName = value; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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.Resources.MSGraph.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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.Resources.MSGraph.Runtime.HttpPipeline Pipeline { get; set; } + + /// + /// The unique identifier (id) for the user, group or service principal being granted the app role. Required on create. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The unique identifier (id) for the user, group or service principal being granted the app role. Required on create.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The unique identifier (id) for the user, group or service principal being granted the app role. Required on create.", + SerializedName = @"principalId", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.DoNotExport] + public string PrincipalId { get => _body.PrincipalId ?? null; set => _body.PrincipalId = 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.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// The display name of the resource app's service principal to which the assignment is made. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The display name of the resource app's service principal to which the assignment is made.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The display name of the resource app's service principal to which the assignment is made.", + SerializedName = @"resourceDisplayName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.DoNotExport] + public string ResourceDisplayName { get => _body.ResourceDisplayName ?? null; set => _body.ResourceDisplayName = value; } + + /// + /// The unique identifier (id) for the resource service principal for which the assignment is made. Required on create. Supports + /// $filter (eq only). + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The unique identifier (id) for the resource service principal for which the assignment is made. Required on create. Supports $filter (eq only).")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The unique identifier (id) for the resource service principal for which the assignment is made. Required on create. Supports $filter (eq only).", + SerializedName = @"resourceId", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.DoNotExport] + public string ResourceId { get => _body.ResourceId ?? null; set => _body.ResourceId = value; } + + /// Backing field for property. + private string _servicePrincipalId; + + /// key: id of servicePrincipal + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "key: id of servicePrincipal")] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"key: id of servicePrincipal", + SerializedName = @"servicePrincipal-id", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Path)] + public string ServicePrincipalId { get => this._servicePrincipalId; set => this._servicePrincipalId = 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.Resources.MSGraph.Models.ApiV10Beta.IOdataError + /// 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); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// 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.Resources.MSGraph.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.Resources.MSGraph.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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.Resources.MSGraph.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.Resources.MSGraph.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ServicePrincipalsUpdateAppRoleAssignments' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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 ) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.DictionaryExtensions.HashTableToDictionary(AdditionalProperties,_body.AdditionalProperties); + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + if (true == this.MyInvocation?.BoundParameters?.ContainsKey("DeletedDateTime")) + { + DeletedDateTime = (global::System.DateTime)this.MyInvocation.BoundParameters["DeletedDateTime"]; + } + if (true == this.MyInvocation?.BoundParameters?.ContainsKey("DisplayName")) + { + DisplayName = (string)this.MyInvocation.BoundParameters["DisplayName"]; + } + if (true == this.MyInvocation?.BoundParameters?.ContainsKey("PrincipalId")) + { + PrincipalId = (string)this.MyInvocation.BoundParameters["PrincipalId"]; + } + if (true == this.MyInvocation?.BoundParameters?.ContainsKey("ResourceDisplayName")) + { + ResourceDisplayName = (string)this.MyInvocation.BoundParameters["ResourceDisplayName"]; + } + if (true == this.MyInvocation?.BoundParameters?.ContainsKey("ResourceId")) + { + ResourceId = (string)this.MyInvocation.BoundParameters["ResourceId"]; + } + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ServicePrincipalsUpdateAppRoleAssignments(ServicePrincipalId, AppRoleAssignmentId, _body, onNoContent, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode.IncludeUpdate); + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ServicePrincipalId=ServicePrincipalId,AppRoleAssignmentId=AppRoleAssignmentId,body=_body}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public UpdateAzADServicePrincipalAppRoleAssignment_UpdateExpanded() + { + + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10Beta.IOdataError + /// 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)?.Error?.Code; + var message = (await response)?.Error?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ServicePrincipalId=ServicePrincipalId, AppRoleAssignmentId=AppRoleAssignmentId, body=_body }) + { + 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 { ServicePrincipalId=ServicePrincipalId, AppRoleAssignmentId=AppRoleAssignmentId, body=_body }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/src/Resources/MSGraph.Autorest/help/Az.MSGraph.md b/src/Resources/MSGraph.Autorest/help/Az.MSGraph.md index 2f2ef487994b..3e22ebb7c197 100644 --- a/src/Resources/MSGraph.Autorest/help/Az.MSGraph.md +++ b/src/Resources/MSGraph.Autorest/help/Az.MSGraph.md @@ -50,6 +50,9 @@ Retrieve a list of organization objects. ### [Get-AzADServicePrincipal](Get-AzADServicePrincipal.md) Lists entities from service principals or get entity from service principals by key +### [Get-AzADServicePrincipalAppRoleAssignment](Get-AzADServicePrincipalAppRoleAssignment.md) +Get appRoleAssignments from servicePrincipals + ### [Get-AzADSpCredential](Get-AzADSpCredential.md) Lists key credentials and password credentials for an service principal. @@ -74,6 +77,9 @@ Create new navigation property ref to owners for groups ### [New-AzADServicePrincipal](New-AzADServicePrincipal.md) Adds new entity to servicePrincipals +### [New-AzADServicePrincipalAppRoleAssignment](New-AzADServicePrincipalAppRoleAssignment.md) +Create new navigation property to appRoleAssignments for servicePrincipals + ### [New-AzADSpCredential](New-AzADSpCredential.md) Creates key credentials or password credentials for an service principal. @@ -108,6 +114,9 @@ Delete ref of navigation property owners for groups ### [Remove-AzADServicePrincipal](Remove-AzADServicePrincipal.md) Deletes entity from service principal. +### [Remove-AzADServicePrincipalAppRoleAssignment](Remove-AzADServicePrincipalAppRoleAssignment.md) +Delete navigation property appRoleAssignments for servicePrincipals + ### [Remove-AzADSpCredential](Remove-AzADSpCredential.md) Removes key credentials or password credentials for an service principal. @@ -126,6 +135,9 @@ Update entity in groups ### [Update-AzADServicePrincipal](Update-AzADServicePrincipal.md) Updates entity in service principal +### [Update-AzADServicePrincipalAppRoleAssignment](Update-AzADServicePrincipalAppRoleAssignment.md) +Update the navigation property appRoleAssignments in servicePrincipals + ### [Update-AzADUser](Update-AzADUser.md) Updates entity in users diff --git a/src/Resources/MSGraph.Autorest/help/Get-AzADServicePrincipalAppRoleAssignment.md b/src/Resources/MSGraph.Autorest/help/Get-AzADServicePrincipalAppRoleAssignment.md new file mode 100644 index 000000000000..d0ed05b49f89 --- /dev/null +++ b/src/Resources/MSGraph.Autorest/help/Get-AzADServicePrincipalAppRoleAssignment.md @@ -0,0 +1,241 @@ +--- +external help file: +Module Name: Az.Resources +online version: https://learn.microsoft.com/powershell/module/az.resources/get-azadserviceprincipalapproleassignment +schema: 2.0.0 +--- + +# Get-AzADServicePrincipalAppRoleAssignment + +## SYNOPSIS +Get appRoleAssignments from servicePrincipals + +## SYNTAX + +### List (Default) +``` +Get-AzADServicePrincipalAppRoleAssignment -ServicePrincipalId [-Count] [-Expand ] + [-Filter ] [-Orderby ] [-Search ] [-Select ] [-First ] + [-Skip ] [-DefaultProfile ] [] +``` + +### Get +``` +Get-AzADServicePrincipalAppRoleAssignment -AppRoleAssignmentId -ServicePrincipalId + [-Expand ] [-Select ] [-DefaultProfile ] [] +``` + +## DESCRIPTION +Get appRoleAssignments from servicePrincipals + +## EXAMPLES + +### Example 1: List assigned app roles +```powershell +Get-AzADServicePrincipalAppRoleAssignment -ServicePrincipalId 71beb965-8347-495d-a589-c21cdde7a722 +``` + +```output +Id AppRoleId PrincipalDisplayName PrincipalId CreatedDateTime +-- --------- -------------------- ----------- --------------- +Zbm-cUeDXUmlicIc3eenIkgIm8kv9kJPj4MFhepACNE 649ae968-bdf9-4f22-bb2c-2aa1b4af0a83 funapp1214 71beb965-8347-495d-a589-c21cdde7a722 12/14/2023 7:04:28 AM +Zbm-cUeDXUmlicIc3eenIhHyPMkzw2VEh76fTc0bGtM e799a9e2-acac-4960-9ba0-6a17661fa16a funapp1214 71beb965-8347-495d-a589-c21cdde7a722 12/14/2023 6:56:52 AM +``` + +List assigned app roles. + +### Example 2: Get by AppRoleAssignmentId +```powershell +Get-AzADServicePrincipalAppRoleAssignment -ServicePrincipalId 71beb965-8347-495d-a589-c21cdde7a722 -AppRoleAssignmentId Zbm-cUeDXUmlicIc3eenIkgIm8kv9kJPj4MFhepACNE +``` + +```output +Id AppRoleId PrincipalDisplayName PrincipalId CreatedDateTime +-- --------- -------------------- ----------- --------------- +Zbm-cUeDXUmlicIc3eenIkgIm8kv9kJPj4MFhepACNE 649ae968-bdf9-4f22-bb2c-2aa1b4af0a83 funapp1214 71beb965-8347-495d-a589-c21cdde7a722 12/14/2023 7:04:28 AM +``` + +Get an assigned app role by Id. + +## PARAMETERS + +### -AppRoleAssignmentId +key: id of appRoleAssignment + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Count +Include count of items + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: List +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Expand +Expand related entities + +```yaml +Type: System.String[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Filter +Filter items by property values + +```yaml +Type: System.String +Parameter Sets: List +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -First +Gets only the first 'n' objects. + +```yaml +Type: System.UInt64 +Parameter Sets: List +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Orderby +Order items by property values + +```yaml +Type: System.String[] +Parameter Sets: List +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Search +Search items by search phrases + +```yaml +Type: System.String +Parameter Sets: List +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Select +Select properties to be returned + +```yaml +Type: System.String[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ServicePrincipalId +key: id of servicePrincipal + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Skip +Ignores the first 'n' objects and then gets the remaining objects. + +```yaml +Type: System.UInt64 +Parameter Sets: List +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRoleAssignment + +## NOTES + +ALIASES + +## RELATED LINKS + diff --git a/src/Resources/MSGraph.Autorest/help/New-AzADServicePrincipalAppRoleAssignment.md b/src/Resources/MSGraph.Autorest/help/New-AzADServicePrincipalAppRoleAssignment.md new file mode 100644 index 000000000000..7e4dcf80407d --- /dev/null +++ b/src/Resources/MSGraph.Autorest/help/New-AzADServicePrincipalAppRoleAssignment.md @@ -0,0 +1,235 @@ +--- +external help file: +Module Name: Az.Resources +online version: https://learn.microsoft.com/powershell/module/az.resources/new-azadserviceprincipalapproleassignment +schema: 2.0.0 +--- + +# New-AzADServicePrincipalAppRoleAssignment + +## SYNOPSIS +Create new navigation property to appRoleAssignments for servicePrincipals + +## SYNTAX + +### ObjectIdWithResourceIdParameterSet (Default) +``` +New-AzADServicePrincipalAppRoleAssignment -ServicePrincipalId -ResourceId + [-AdditionalProperties ] [-AppRoleId ] [-DefaultProfile ] [-Confirm] [-WhatIf] + [] +``` + +### ObjectIdWithResourceDisplayNameParameterSet +``` +New-AzADServicePrincipalAppRoleAssignment -ServicePrincipalId -ResourceDisplayName + [-AdditionalProperties ] [-AppRoleId ] [-DefaultProfile ] [-Confirm] [-WhatIf] + [] +``` + +### SPNWithResourceDisplayNameParameterSet +``` +New-AzADServicePrincipalAppRoleAssignment -ResourceDisplayName -ServicePrincipalDisplayName + [-AdditionalProperties ] [-AppRoleId ] [-DefaultProfile ] [-Confirm] [-WhatIf] + [] +``` + +### SPNWithResourceIdParameterSet +``` +New-AzADServicePrincipalAppRoleAssignment -ResourceId -ServicePrincipalDisplayName + [-AdditionalProperties ] [-AppRoleId ] [-DefaultProfile ] [-Confirm] [-WhatIf] + [] +``` + +## DESCRIPTION +Create new navigation property to appRoleAssignments for servicePrincipals + +## EXAMPLES + +### Example 1: ObjectIdWithResourceIdParameterSet +```powershell +New-AzADServicePrincipalAppRoleAssignment -ServicePrincipalId 71beb965-8347-495d-a589-c21cdde7a722 -ResourceId 351fa797-c81a-4998-9720-4c2ecb6c7abc -AppRoleId 649ae968-bdf9-4f22-bb2c-2aa1b4af0a83 +``` + +```output +Id AppRoleId PrincipalDisplayName PrincipalId CreatedDateTime +-- --------- -------------------- ----------- --------------- +Zbm-cUeDXUmlicIc3eenIkgIm8kv9kJPj4MFhepACNE 649ae968-bdf9-4f22-bb2c-2aa1b4af0a83 funapp1214 71beb965-8347-495d-a589-c21cdde7a722 12/14/2023 7:04:28 AM +``` + +Create an appRoleAssignment using ServicePrincipalId and ResourceId. + +### Example 2: SPNWithResourceDisplayNameParameterSet +```powershell +New-AzADServicePrincipalAppRoleAssignment -ServicePrincipalDisplayName funapp1214 -ResourceDisplayName nori-sp -AppRoleId 649ae968-bdf9-4f22-bb2c-2aa1b4af0a83 +``` + +```output +Id AppRoleId PrincipalDisplayName PrincipalId CreatedDateTime +-- --------- -------------------- ----------- --------------- +Zbm-cUeDXUmlicIc3eenIlqgWRlWp2hFrXIJiqP2j78 649ae968-bdf9-4f22-bb2c-2aa1b4af0a83 funapp1214 71beb965-8347-495d-a589-c21cdde7a722 12/14/2023 7:07:16 AM +``` + +Create an appRoleAssignment for service principal using ServicePrincipal DisplayName and Resource DisplayName. + +## PARAMETERS + +### -AdditionalProperties +ParameterSetName='CreateExpanded')] +Additional Parameters + +```yaml +Type: System.Collections.Hashtable +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AppRoleId +The identifier (id) for the app role which is assigned to the principal. +This app role must be exposed in the appRoles property on the resource application's service principal (resourceId). +If the resource application has not declared any app roles, a default app role ID of 00000000-0000-0000-0000-000000000000 can be specified to signal that the principal is assigned to the resource app without any specific app roles. +Required on create. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceDisplayName +The display name of the resource app's service principal to which the assignment is made. + +```yaml +Type: System.String +Parameter Sets: ObjectIdWithResourceDisplayNameParameterSet, SPNWithResourceDisplayNameParameterSet +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceId +The unique identifier (id) for the resource service principal for which the assignment is made. +Required on create. +Supports $filter (eq only). + +```yaml +Type: System.String +Parameter Sets: ObjectIdWithResourceIdParameterSet, SPNWithResourceIdParameterSet +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ServicePrincipalDisplayName +The name displayed in directory + +```yaml +Type: System.String +Parameter Sets: SPNWithResourceDisplayNameParameterSet, SPNWithResourceIdParameterSet +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ServicePrincipalId +The unique identifier (id) for the user, group or service principal being granted the app role. +Required on create. + +```yaml +Type: System.String +Parameter Sets: ObjectIdWithResourceDisplayNameParameterSet, ObjectIdWithResourceIdParameterSet +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRoleAssignment + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRoleAssignment + +## NOTES + +ALIASES + +## RELATED LINKS + diff --git a/src/Resources/MSGraph.Autorest/help/Remove-AzADServicePrincipalAppRoleAssignment.md b/src/Resources/MSGraph.Autorest/help/Remove-AzADServicePrincipalAppRoleAssignment.md new file mode 100644 index 000000000000..c7a4db5db2f0 --- /dev/null +++ b/src/Resources/MSGraph.Autorest/help/Remove-AzADServicePrincipalAppRoleAssignment.md @@ -0,0 +1,154 @@ +--- +external help file: +Module Name: Az.Resources +online version: https://learn.microsoft.com/powershell/module/az.resources/remove-azadserviceprincipalapproleassignment +schema: 2.0.0 +--- + +# Remove-AzADServicePrincipalAppRoleAssignment + +## SYNOPSIS +Delete navigation property appRoleAssignments for servicePrincipals + +## SYNTAX + +``` +Remove-AzADServicePrincipalAppRoleAssignment -AppRoleAssignmentId -ServicePrincipalId + [-IfMatch ] [-DefaultProfile ] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Delete navigation property appRoleAssignments for servicePrincipals + +## EXAMPLES + +### Example 1: Remove an app role from service principal +```powershell +Remove-AzADServicePrincipalAppRoleAssignment -AppRoleAssignmentId Zbm-cUeDXUmlicIc3eenIlTWN1A5UVFMigS0D3ED-dk -ServicePrincipalId 71beb965-8347-495d-a589-c21cdde7a722 +``` + +Remove an app role from service principal. + +## PARAMETERS + +### -AppRoleAssignmentId +key: id of appRoleAssignment + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -IfMatch +ETag + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ServicePrincipalId +key: id of servicePrincipal + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### System.Boolean + +## NOTES + +ALIASES + +## RELATED LINKS + diff --git a/src/Resources/MSGraph.Autorest/help/Update-AzADServicePrincipalAppRoleAssignment.md b/src/Resources/MSGraph.Autorest/help/Update-AzADServicePrincipalAppRoleAssignment.md new file mode 100644 index 000000000000..7ad7e2e1d167 --- /dev/null +++ b/src/Resources/MSGraph.Autorest/help/Update-AzADServicePrincipalAppRoleAssignment.md @@ -0,0 +1,214 @@ +--- +external help file: +Module Name: Az.Resources +online version: https://learn.microsoft.com/powershell/module/az.resources/update-azadserviceprincipalapproleassignment +schema: 2.0.0 +--- + +# Update-AzADServicePrincipalAppRoleAssignment + +## SYNOPSIS +Update the navigation property appRoleAssignments in servicePrincipals + +## SYNTAX + +### UpdateExpanded (Default) +``` +Update-AzADServicePrincipalAppRoleAssignment -AppRoleAssignmentId -ServicePrincipalId + [-AdditionalProperties ] [-AppRoleId ] [-DefaultProfile ] [-PassThru] [-Confirm] + [-WhatIf] [] +``` + +### Update +``` +Update-AzADServicePrincipalAppRoleAssignment -AppRoleAssignmentId -ServicePrincipalId + -Body [-DefaultProfile ] [-PassThru] [-Confirm] [-WhatIf] + [] +``` + +## DESCRIPTION +Update the navigation property appRoleAssignments in servicePrincipals + +## EXAMPLES + +### Example 1: Update the AppRoleId +```powershell +Update-AzADServicePrincipalAppRoleAssignment -AppRoleAssignmentId Zbm-cUeDXUmlicIc3eenIoFW9pZ_gRBIudKgu0gaMIw -ServicePrincipalId 71beb965-8347-495d-a589-c21cdde7a722 -AppRoleId 649ae968-bdf9-4f22-bb2c-2aa1b4af0a83 +``` + +Update the assigned App role id. + +## PARAMETERS + +### -AdditionalProperties +Additional Parameters + +```yaml +Type: System.Collections.Hashtable +Parameter Sets: UpdateExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AppRoleAssignmentId +key: id of appRoleAssignment + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AppRoleId +The identifier (id) for the app role which is assigned to the principal. +This app role must be exposed in the appRoles property on the resource application's service principal (resourceId). +If the resource application has not declared any app roles, a default app role ID of 00000000-0000-0000-0000-000000000000 can be specified to signal that the principal is assigned to the resource app without any specific app roles. +Required on create. + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Body +Represents an Azure Active Directory object. +The directoryObject type is the base type for many other directory entity types. +To construct, see NOTES section for BODY properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRoleAssignment +Parameter Sets: Update +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ServicePrincipalId +key: id of servicePrincipal + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRoleAssignment + +## OUTPUTS + +### System.Boolean + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +BODY : Represents an Azure Active Directory object. The directoryObject type is the base type for many other directory entity types. + - `[(Any) ]`: This indicates any property can be added to this object. + - `[DeletedDateTime ]`: + - `[DisplayName ]`: The name displayed in directory + - `[AppRoleId ]`: The identifier (id) for the app role which is assigned to the principal. This app role must be exposed in the appRoles property on the resource application's service principal (resourceId). If the resource application has not declared any app roles, a default app role ID of 00000000-0000-0000-0000-000000000000 can be specified to signal that the principal is assigned to the resource app without any specific app roles. Required on create. + - `[PrincipalId ]`: The unique identifier (id) for the user, group or service principal being granted the app role. Required on create. + - `[ResourceDisplayName ]`: The display name of the resource app's service principal to which the assignment is made. + - `[ResourceId ]`: The unique identifier (id) for the resource service principal for which the assignment is made. Required on create. Supports $filter (eq only). + +## RELATED LINKS + diff --git a/src/Resources/MSGraph.Autorest/internal/New-AzADServicePrincipalAppRoleAssignment.ps1 b/src/Resources/MSGraph.Autorest/internal/New-AzADServicePrincipalAppRoleAssignment.ps1 new file mode 100644 index 000000000000..cd12a19c0398 --- /dev/null +++ b/src/Resources/MSGraph.Autorest/internal/New-AzADServicePrincipalAppRoleAssignment.ps1 @@ -0,0 +1,196 @@ + +# ---------------------------------------------------------------------------------- +# 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 new navigation property to appRoleAssignments for servicePrincipals +.Description +Create new navigation property to appRoleAssignments for servicePrincipals +.Example +New-AzADServicePrincipalAppRoleAssignment -ServicePrincipalId 71beb965-8347-495d-a589-c21cdde7a722 -ResourceId 351fa797-c81a-4998-9720-4c2ecb6c7abc -AppRoleId 649ae968-bdf9-4f22-bb2c-2aa1b4af0a83 +.Example +New-AzADServicePrincipalAppRoleAssignment -ServicePrincipalDisplayName funapp1214 -ResourceDisplayName nori-sp -AppRoleId 649ae968-bdf9-4f22-bb2c-2aa1b4af0a83 + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRoleAssignment +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRoleAssignment +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +BODY : Represents an Azure Active Directory object. The directoryObject type is the base type for many other directory entity types. + [(Any) ]: This indicates any property can be added to this object. + [DeletedDateTime ]: + [DisplayName ]: The name displayed in directory + [AppRoleId ]: The identifier (id) for the app role which is assigned to the principal. This app role must be exposed in the appRoles property on the resource application's service principal (resourceId). If the resource application has not declared any app roles, a default app role ID of 00000000-0000-0000-0000-000000000000 can be specified to signal that the principal is assigned to the resource app without any specific app roles. Required on create. + [PrincipalId ]: The unique identifier (id) for the user, group or service principal being granted the app role. Required on create. + [ResourceDisplayName ]: The display name of the resource app's service principal to which the assignment is made. + [ResourceId ]: The unique identifier (id) for the resource service principal for which the assignment is made. Required on create. Supports $filter (eq only). +.Link +https://learn.microsoft.com/powershell/module/az.resources/new-azadserviceprincipalapproleassignment +#> +function New-AzADServicePrincipalAppRoleAssignment { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRoleAssignment])] +[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Path')] + [System.String] + # key: id of servicePrincipal + ${ServicePrincipalId}, + + [Parameter(ParameterSetName='Create', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRoleAssignment] + # Represents an Azure Active Directory object. + # The directoryObject type is the base type for many other directory entity types. + # To construct, see NOTES section for BODY properties and create a hash table. + ${Body}, + + [Parameter(ParameterSetName='CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] + [System.Collections.Hashtable] + # Additional Parameters + ${AdditionalProperties}, + + [Parameter(ParameterSetName='CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] + [System.String] + # The identifier (id) for the app role which is assigned to the principal. + # This app role must be exposed in the appRoles property on the resource application's service principal (resourceId). + # If the resource application has not declared any app roles, a default app role ID of 00000000-0000-0000-0000-000000000000 can be specified to signal that the principal is assigned to the resource app without any specific app roles. + # Required on create. + ${AppRoleId}, + + [Parameter(ParameterSetName='CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] + [System.String] + # The name displayed in directory + ${DisplayName}, + + [Parameter(ParameterSetName='CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] + [System.String] + # The unique identifier (id) for the user, group or service principal being granted the app role. + # Required on create. + ${PrincipalId}, + + [Parameter(ParameterSetName='CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] + [System.String] + # The display name of the resource app's service principal to which the assignment is made. + ${ResourceDisplayName}, + + [Parameter(ParameterSetName='CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] + [System.String] + # The unique identifier (id) for the resource service principal for which the assignment is made. + # Required on create. + # Supports $filter (eq only). + ${ResourceId}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + $mapping = @{ + Create = 'Az.MSGraph.private\New-AzADServicePrincipalAppRoleAssignment_Create'; + CreateExpanded = 'Az.MSGraph.private\New-AzADServicePrincipalAppRoleAssignment_CreateExpanded'; + } + + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + + throw + } + +} +end { + try { + $steppablePipeline.End() + + } catch { + + throw + } +} +} diff --git a/src/Resources/MSGraph.Autorest/internal/ProxyCmdletDefinitions.ps1 b/src/Resources/MSGraph.Autorest/internal/ProxyCmdletDefinitions.ps1 index d8c0566a2a5d..81e449083dc4 100644 --- a/src/Resources/MSGraph.Autorest/internal/ProxyCmdletDefinitions.ps1 +++ b/src/Resources/MSGraph.Autorest/internal/ProxyCmdletDefinitions.ps1 @@ -4593,6 +4593,187 @@ end { } } +<# +.Synopsis +Create new navigation property to appRoleAssignments for servicePrincipals +.Description +Create new navigation property to appRoleAssignments for servicePrincipals +.Example +New-AzADServicePrincipalAppRoleAssignment -ServicePrincipalId 71beb965-8347-495d-a589-c21cdde7a722 -ResourceId 351fa797-c81a-4998-9720-4c2ecb6c7abc -AppRoleId 649ae968-bdf9-4f22-bb2c-2aa1b4af0a83 +.Example +New-AzADServicePrincipalAppRoleAssignment -ServicePrincipalDisplayName funapp1214 -ResourceDisplayName nori-sp -AppRoleId 649ae968-bdf9-4f22-bb2c-2aa1b4af0a83 + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRoleAssignment +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRoleAssignment +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +BODY : Represents an Azure Active Directory object. The directoryObject type is the base type for many other directory entity types. + [(Any) ]: This indicates any property can be added to this object. + [DeletedDateTime ]: + [DisplayName ]: The name displayed in directory + [AppRoleId ]: The identifier (id) for the app role which is assigned to the principal. This app role must be exposed in the appRoles property on the resource application's service principal (resourceId). If the resource application has not declared any app roles, a default app role ID of 00000000-0000-0000-0000-000000000000 can be specified to signal that the principal is assigned to the resource app without any specific app roles. Required on create. + [PrincipalId ]: The unique identifier (id) for the user, group or service principal being granted the app role. Required on create. + [ResourceDisplayName ]: The display name of the resource app's service principal to which the assignment is made. + [ResourceId ]: The unique identifier (id) for the resource service principal for which the assignment is made. Required on create. Supports $filter (eq only). +.Link +https://learn.microsoft.com/powershell/module/az.resources/new-azadserviceprincipalapproleassignment +#> +function New-AzADServicePrincipalAppRoleAssignment { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRoleAssignment])] +[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Path')] + [System.String] + # key: id of servicePrincipal + ${ServicePrincipalId}, + + [Parameter(ParameterSetName='Create', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRoleAssignment] + # Represents an Azure Active Directory object. + # The directoryObject type is the base type for many other directory entity types. + # To construct, see NOTES section for BODY properties and create a hash table. + ${Body}, + + [Parameter(ParameterSetName='CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] + [System.Collections.Hashtable] + # Additional Parameters + ${AdditionalProperties}, + + [Parameter(ParameterSetName='CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] + [System.String] + # The identifier (id) for the app role which is assigned to the principal. + # This app role must be exposed in the appRoles property on the resource application's service principal (resourceId). + # If the resource application has not declared any app roles, a default app role ID of 00000000-0000-0000-0000-000000000000 can be specified to signal that the principal is assigned to the resource app without any specific app roles. + # Required on create. + ${AppRoleId}, + + [Parameter(ParameterSetName='CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] + [System.String] + # The name displayed in directory + ${DisplayName}, + + [Parameter(ParameterSetName='CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] + [System.String] + # The unique identifier (id) for the user, group or service principal being granted the app role. + # Required on create. + ${PrincipalId}, + + [Parameter(ParameterSetName='CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] + [System.String] + # The display name of the resource app's service principal to which the assignment is made. + ${ResourceDisplayName}, + + [Parameter(ParameterSetName='CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] + [System.String] + # The unique identifier (id) for the resource service principal for which the assignment is made. + # Required on create. + # Supports $filter (eq only). + ${ResourceId}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + $mapping = @{ + Create = 'Az.MSGraph.private\New-AzADServicePrincipalAppRoleAssignment_Create'; + CreateExpanded = 'Az.MSGraph.private\New-AzADServicePrincipalAppRoleAssignment_CreateExpanded'; + } + + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + + throw + } + +} +end { + try { + $steppablePipeline.End() + + } catch { + + throw + } +} +} + <# .Synopsis Add new entity to servicePrincipals diff --git a/src/Resources/MSGraph.Autorest/test/Get-AzADServicePrincipalAppRoleAssignment.Tests.ps1 b/src/Resources/MSGraph.Autorest/test/Get-AzADServicePrincipalAppRoleAssignment.Tests.ps1 new file mode 100644 index 000000000000..ee253bd1f443 --- /dev/null +++ b/src/Resources/MSGraph.Autorest/test/Get-AzADServicePrincipalAppRoleAssignment.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzADServicePrincipalAppRoleAssignment')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzADServicePrincipalAppRoleAssignment.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzADServicePrincipalAppRoleAssignment' { + It 'List' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'Get' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/src/Resources/MSGraph.Autorest/test/New-AzADServicePrincipalAppRoleAssignment.Tests.ps1 b/src/Resources/MSGraph.Autorest/test/New-AzADServicePrincipalAppRoleAssignment.Tests.ps1 new file mode 100644 index 000000000000..9416326b85db --- /dev/null +++ b/src/Resources/MSGraph.Autorest/test/New-AzADServicePrincipalAppRoleAssignment.Tests.ps1 @@ -0,0 +1,34 @@ +if(($null -eq $TestName) -or ($TestName -contains 'New-AzADServicePrincipalAppRoleAssignment')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'New-AzADServicePrincipalAppRoleAssignment.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'New-AzADServicePrincipalAppRoleAssignment' { + It 'ObjectIdWithResourceIdParameterSet' -skip { + $appRa = New-AzADServicePrincipalAppRoleAssignment -ServicePrincipalId $env.spId1 -ResourceId $env.resourceId1 -AppRoleId $env.appRoleId + $appRa.AppRoleId | Should -Be $env.appRoleId + } + + It 'ObjectIdWithResourceDisplayNameParameterSet' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'SPNWithResourceIdParameterSet' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'SPNWithResourceDisplayNameParameterSet' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/src/Resources/MSGraph.Autorest/test/Remove-AzADServicePrincipalAppRoleAssignment.Tests.ps1 b/src/Resources/MSGraph.Autorest/test/Remove-AzADServicePrincipalAppRoleAssignment.Tests.ps1 new file mode 100644 index 000000000000..d52ad6731787 --- /dev/null +++ b/src/Resources/MSGraph.Autorest/test/Remove-AzADServicePrincipalAppRoleAssignment.Tests.ps1 @@ -0,0 +1,21 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Remove-AzADServicePrincipalAppRoleAssignment')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Remove-AzADServicePrincipalAppRoleAssignment.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Remove-AzADServicePrincipalAppRoleAssignment' { + It 'Delete' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/src/Resources/MSGraph.Autorest/test/Update-AzADServicePrincipalAppRoleAssignment.Tests.ps1 b/src/Resources/MSGraph.Autorest/test/Update-AzADServicePrincipalAppRoleAssignment.Tests.ps1 new file mode 100644 index 000000000000..da6e41f7dc0a --- /dev/null +++ b/src/Resources/MSGraph.Autorest/test/Update-AzADServicePrincipalAppRoleAssignment.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Update-AzADServicePrincipalAppRoleAssignment')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Update-AzADServicePrincipalAppRoleAssignment.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Update-AzADServicePrincipalAppRoleAssignment' { + It 'UpdateExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'Update' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/src/Resources/MSGraph.Autorest/test/localEnv.json b/src/Resources/MSGraph.Autorest/test/localEnv.json index b7e55ac9ef30..5ec84a0e3729 100644 --- a/src/Resources/MSGraph.Autorest/test/localEnv.json +++ b/src/Resources/MSGraph.Autorest/test/localEnv.json @@ -9,5 +9,8 @@ "spName1": "2022-02-22-testsphql7405x", "homepage1": "https://2022-02-22-home1.com", "appName1": "2022-02-22-testappec56qaw2", - "appName2": "2022-02-22-testappdhlw3jr1" + "appName2": "2022-02-22-testappdhlw3jr1", + "appRoleId": "e799a9e2-acac-4960-9ba0-6a17661fa16a", + "spId1": "71beb965-8347-495d-a589-c21cdde7a722", + "resourceId1": "351fa797-c81a-4998-9720-4c2ecb6c7abc" } diff --git a/src/Resources/OpenApiSpecs/v1.0/Applications.yml b/src/Resources/OpenApiSpecs/v1.0/Applications.yml index 7c55243bc5cd..24bbfde25e0c 100644 --- a/src/Resources/OpenApiSpecs/v1.0/Applications.yml +++ b/src/Resources/OpenApiSpecs/v1.0/Applications.yml @@ -1242,6 +1242,252 @@ paths: default: $ref: '#/components/responses/error' x-ms-docs-operation-type: operation + '/servicePrincipals/{servicePrincipal-id}/appRoleAssignments': + get: + tags: + - servicePrincipals.appRoleAssignment + summary: Get appRoleAssignments from servicePrincipals + operationId: servicePrincipals_ListAppRoleAssignments + parameters: + - name: servicePrincipal-id + in: path + description: 'key: id of servicePrincipal' + required: true + schema: + type: string + x-ms-docs-key-type: servicePrincipal + - $ref: '#/components/parameters/top' + - $ref: '#/components/parameters/skip' + - $ref: '#/components/parameters/search' + - $ref: '#/components/parameters/filter' + - $ref: '#/components/parameters/count' + - name: $orderby + in: query + description: Order items by property values + style: form + explode: false + schema: + uniqueItems: true + type: array + items: + enum: + - id + - id desc + - deletedDateTime + - deletedDateTime desc + - appRoleId + - appRoleId desc + - createdDateTime + - createdDateTime desc + - principalDisplayName + - principalDisplayName desc + - principalId + - principalId desc + - principalType + - principalType desc + - resourceDisplayName + - resourceDisplayName desc + - resourceId + - resourceId desc + type: string + - name: $select + in: query + description: Select properties to be returned + style: form + explode: false + schema: + uniqueItems: true + type: array + items: + enum: + - id + - deletedDateTime + - appRoleId + - createdDateTime + - principalDisplayName + - principalId + - principalType + - resourceDisplayName + - resourceId + type: string + - name: $expand + in: query + description: Expand related entities + style: form + explode: false + schema: + uniqueItems: true + type: array + items: + enum: + - '*' + type: string + responses: + '200': + $ref: '#/components/responses/microsoft.graph.appRoleAssignmentCollectionResponse' + default: + $ref: '#/components/responses/error' + x-ms-pageable: + nextLinkName: '@odata.nextLink' + operationName: listMore + x-ms-docs-operation-type: operation + post: + tags: + - servicePrincipals.appRoleAssignment + summary: Create new navigation property to appRoleAssignments for servicePrincipals + operationId: servicePrincipals_CreateAppRoleAssignments + parameters: + - name: servicePrincipal-id + in: path + description: 'key: id of servicePrincipal' + required: true + schema: + type: string + x-ms-docs-key-type: servicePrincipal + requestBody: + description: New navigation property + content: + application/json: + schema: + $ref: '#/components/schemas/microsoft.graph.appRoleAssignment' + required: true + responses: + '201': + description: Created navigation property. + content: + application/json: + schema: + $ref: '#/components/schemas/microsoft.graph.appRoleAssignment' + default: + $ref: '#/components/responses/error' + x-ms-docs-operation-type: operation + '/servicePrincipals/{servicePrincipal-id}/appRoleAssignments/{appRoleAssignment-id}': + get: + tags: + - servicePrincipals.appRoleAssignment + summary: Get appRoleAssignments from servicePrincipals + operationId: servicePrincipals_GetAppRoleAssignments + parameters: + - name: servicePrincipal-id + in: path + description: 'key: id of servicePrincipal' + required: true + schema: + type: string + x-ms-docs-key-type: servicePrincipal + - name: appRoleAssignment-id + in: path + description: 'key: id of appRoleAssignment' + required: true + schema: + type: string + x-ms-docs-key-type: appRoleAssignment + - name: $select + in: query + description: Select properties to be returned + style: form + explode: false + schema: + uniqueItems: true + type: array + items: + enum: + - id + - deletedDateTime + - appRoleId + - createdDateTime + - principalDisplayName + - principalId + - principalType + - resourceDisplayName + - resourceId + type: string + - name: $expand + in: query + description: Expand related entities + style: form + explode: false + schema: + uniqueItems: true + type: array + items: + enum: + - '*' + type: string + responses: + '200': + description: Retrieved navigation property + content: + application/json: + schema: + $ref: '#/components/schemas/microsoft.graph.appRoleAssignment' + default: + $ref: '#/components/responses/error' + x-ms-docs-operation-type: operation + patch: + tags: + - servicePrincipals.appRoleAssignment + summary: Update the navigation property appRoleAssignments in servicePrincipals + operationId: servicePrincipals_UpdateAppRoleAssignments + parameters: + - name: servicePrincipal-id + in: path + description: 'key: id of servicePrincipal' + required: true + schema: + type: string + x-ms-docs-key-type: servicePrincipal + - name: appRoleAssignment-id + in: path + description: 'key: id of appRoleAssignment' + required: true + schema: + type: string + x-ms-docs-key-type: appRoleAssignment + requestBody: + description: New navigation property values + content: + application/json: + schema: + $ref: '#/components/schemas/microsoft.graph.appRoleAssignment' + required: true + responses: + '204': + description: Success + default: + $ref: '#/components/responses/error' + x-ms-docs-operation-type: operation + delete: + tags: + - servicePrincipals.appRoleAssignment + summary: Delete navigation property appRoleAssignments for servicePrincipals + operationId: servicePrincipals_DeleteAppRoleAssignments + parameters: + - name: servicePrincipal-id + in: path + description: 'key: id of servicePrincipal' + required: true + schema: + type: string + x-ms-docs-key-type: servicePrincipal + - name: appRoleAssignment-id + in: path + description: 'key: id of appRoleAssignment' + required: true + schema: + type: string + x-ms-docs-key-type: appRoleAssignment + - name: If-Match + in: header + description: ETag + schema: + type: string + responses: + '204': + description: Success + default: + $ref: '#/components/responses/error' + x-ms-docs-operation-type: operation '/servicePrincipals/{servicePrincipal-id}/federatedIdentityCredentials': get: tags: @@ -2460,6 +2706,18 @@ components: nullable: true additionalProperties: type: object + microsoft.graph.appRoleAssignmentCollectionResponse: + title: Collection of appRoleAssignment + type: object + properties: + value: + type: array + items: + $ref: '#/components/schemas/microsoft.graph.appRoleAssignment' + '@odata.nextLink': + type: string + additionalProperties: + type: object microsoft.graph.informationalUrl: title: informationalUrl type: object @@ -2830,6 +3088,12 @@ components: application/json: schema: $ref: '#/components/schemas/microsoft.graph.federatedIdentityCredentialCollectionResponse' + microsoft.graph.appRoleAssignmentCollectionResponse: + description: Retrieved collection + content: + application/json: + schema: + $ref: '#/components/schemas/microsoft.graph.appRoleAssignmentCollectionResponse' parameters: top: name: $top @@ -2873,4 +3137,4 @@ components: tokenUrl: https://login.microsoftonline.com/common/oauth2/v2.0/token scopes: { } security: - - azureaadv2: [ ] \ No newline at end of file + - azureaadv2: [ ] diff --git a/src/Resources/Resources/Az.Resources.psd1 b/src/Resources/Resources/Az.Resources.psd1 index 60d66e5e9102..ee8a3d5c19c7 100644 --- a/src/Resources/Resources/Az.Resources.psd1 +++ b/src/Resources/Resources/Az.Resources.psd1 @@ -3,7 +3,7 @@ # # Generated by: Microsoft Corporation # -# Generated on: 12/5/2023 +# Generated on: 12/14/2023 # @{ @@ -94,8 +94,9 @@ FunctionsToExport = 'Add-AzADAppPermission', 'Add-AzADGroupMember', 'Get-AzADAppCredential', 'Get-AzADAppFederatedCredential', 'Get-AzADApplication', 'Get-AzADAppPermission', 'Get-AzADGroup', 'Get-AzADGroupMember', 'Get-AzADGroupOwner', 'Get-AzADOrganization', - 'Get-AzADServicePrincipal', 'Get-AzADSpCredential', 'Get-AzADUser', - 'Get-AzRoleAssignmentSchedule', + 'Get-AzADServicePrincipal', + 'Get-AzADServicePrincipalAppRoleAssignment', 'Get-AzADSpCredential', + 'Get-AzADUser', 'Get-AzRoleAssignmentSchedule', 'Get-AzRoleAssignmentScheduleInstance', 'Get-AzRoleAssignmentScheduleRequest', 'Get-AzRoleEligibilitySchedule', @@ -105,20 +106,23 @@ FunctionsToExport = 'Add-AzADAppPermission', 'Add-AzADGroupMember', 'Get-AzRoleManagementPolicyAssignment', 'New-AzADAppCredential', 'New-AzADAppFederatedCredential', 'New-AzADApplication', 'New-AzADGroup', 'New-AzADGroupOwner', 'New-AzADServicePrincipal', - 'New-AzADSpCredential', 'New-AzADUser', - 'New-AzRoleAssignmentScheduleRequest', + 'New-AzADServicePrincipalAppRoleAssignment', 'New-AzADSpCredential', + 'New-AzADUser', 'New-AzRoleAssignmentScheduleRequest', 'New-AzRoleEligibilityScheduleRequest', 'New-AzRoleManagementPolicyAssignment', 'Remove-AzADAppCredential', 'Remove-AzADAppFederatedCredential', 'Remove-AzADApplication', 'Remove-AzADAppPermission', 'Remove-AzADGroup', 'Remove-AzADGroupMember', 'Remove-AzADGroupOwner', - 'Remove-AzADServicePrincipal', 'Remove-AzADSpCredential', - 'Remove-AzADUser', 'Remove-AzRoleManagementPolicy', + 'Remove-AzADServicePrincipal', + 'Remove-AzADServicePrincipalAppRoleAssignment', + 'Remove-AzADSpCredential', 'Remove-AzADUser', + 'Remove-AzRoleManagementPolicy', 'Remove-AzRoleManagementPolicyAssignment', 'Stop-AzRoleAssignmentScheduleRequest', 'Stop-AzRoleEligibilityScheduleRequest', 'Update-AzADAppFederatedCredential', 'Update-AzADApplication', - 'Update-AzADGroup', 'Update-AzADServicePrincipal', 'Update-AzADUser', + 'Update-AzADGroup', 'Update-AzADServicePrincipal', + 'Update-AzADServicePrincipalAppRoleAssignment', 'Update-AzADUser', 'Update-AzRoleManagementPolicy' # Cmdlets to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no cmdlets to export. diff --git a/src/Resources/Resources/ChangeLog.md b/src/Resources/Resources/ChangeLog.md index db7cf5044075..61044df62404 100644 --- a/src/Resources/Resources/ChangeLog.md +++ b/src/Resources/Resources/ChangeLog.md @@ -19,6 +19,7 @@ --> ## Upcoming Release +* Added AppRoleAssigment related commands for service principal. [#18412] * Added `-WithSource` parameter to `Publish-AzBicepModule` for publishing source with a module (currently experimental) * Supported nullable Bicep parameters in Deployment cmdlets diff --git a/src/Resources/Resources/help/Add-AzADGroupMember.md b/src/Resources/Resources/help/Add-AzADGroupMember.md index 441b52770fc3..74a815f14f0e 100644 --- a/src/Resources/Resources/help/Add-AzADGroupMember.md +++ b/src/Resources/Resources/help/Add-AzADGroupMember.md @@ -554,3 +554,6 @@ TARGETGROUPOBJECT : The target group object, could be used ## RELATED LINKS ## RELATED LINKS + + +## RELATED LINKS diff --git a/src/Resources/Resources/help/Get-AzADAppCredential.md b/src/Resources/Resources/help/Get-AzADAppCredential.md index abb28048721f..21c134d02cfc 100644 --- a/src/Resources/Resources/help/Get-AzADAppCredential.md +++ b/src/Resources/Resources/help/Get-AzADAppCredential.md @@ -425,3 +425,6 @@ APPLICATIONOBJECT : The application object, could be ## RELATED LINKS ## RELATED LINKS + + +## RELATED LINKS diff --git a/src/Resources/Resources/help/Get-AzADAppFederatedCredential.md b/src/Resources/Resources/help/Get-AzADAppFederatedCredential.md index b3a540bcfc82..76deff747c88 100644 --- a/src/Resources/Resources/help/Get-AzADAppFederatedCredential.md +++ b/src/Resources/Resources/help/Get-AzADAppFederatedCredential.md @@ -505,3 +505,6 @@ APPLICATIONOBJECT : application object ## RELATED LINKS ## RELATED LINKS + + +## RELATED LINKS diff --git a/src/Resources/Resources/help/Get-AzADGroupMember.md b/src/Resources/Resources/help/Get-AzADGroupMember.md index fd015a1d5b47..f34ad35cad87 100644 --- a/src/Resources/Resources/help/Get-AzADGroupMember.md +++ b/src/Resources/Resources/help/Get-AzADGroupMember.md @@ -571,3 +571,6 @@ GROUPOBJECT : The target group object, could be used as pi ## RELATED LINKS ## RELATED LINKS + + +## RELATED LINKS diff --git a/src/Resources/Resources/help/Get-AzADServicePrincipal.md b/src/Resources/Resources/help/Get-AzADServicePrincipal.md index 158cc18a4c85..9b147b3a5d2f 100644 --- a/src/Resources/Resources/help/Get-AzADServicePrincipal.md +++ b/src/Resources/Resources/help/Get-AzADServicePrincipal.md @@ -637,3 +637,6 @@ APPLICATIONOBJECT : The service principal object, co ## RELATED LINKS ## RELATED LINKS + + +## RELATED LINKS diff --git a/src/Resources/Resources/help/Get-AzADServicePrincipalAppRoleAssignment.md b/src/Resources/Resources/help/Get-AzADServicePrincipalAppRoleAssignment.md new file mode 100644 index 000000000000..aace6eaee75b --- /dev/null +++ b/src/Resources/Resources/help/Get-AzADServicePrincipalAppRoleAssignment.md @@ -0,0 +1,223 @@ +--- +external help file: Az.Resources-help.xml +Module Name: Az.Resources +online version: https://learn.microsoft.com/powershell/module/az.resources/get-azadserviceprincipalapproleassignment +schema: 2.0.0 +--- + +# Get-AzADServicePrincipalAppRoleAssignment + +## SYNOPSIS +Get appRoleAssignments from servicePrincipals + +## SYNTAX + +### List (Default) +``` +Get-AzADServicePrincipalAppRoleAssignment -ServicePrincipalId [-Expand ] + [-Select ] [-Count] [-Filter ] [-Orderby ] [-Search ] [-First ] + [-Skip ] [-DefaultProfile ] [] +``` + +### Get +``` +Get-AzADServicePrincipalAppRoleAssignment -ServicePrincipalId -AppRoleAssignmentId + [-Expand ] [-Select ] [-DefaultProfile ] [] +``` + +## DESCRIPTION +Get appRoleAssignments from servicePrincipals + +## EXAMPLES + +### EXAMPLE 1 +``` +Get-AzADServicePrincipalAppRoleAssignment -ServicePrincipalId 71beb965-8347-495d-a589-c21cdde7a722 +``` + +### EXAMPLE 2 +``` +Get-AzADServicePrincipalAppRoleAssignment -ServicePrincipalId 71beb965-8347-495d-a589-c21cdde7a722 -AppRoleAssignmentId Zbm-cUeDXUmlicIc3eenIkgIm8kv9kJPj4MFhepACNE +``` + +## PARAMETERS + +### -AppRoleAssignmentId +key: id of appRoleAssignment + +```yaml +Type: String +Parameter Sets: Get +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Count +Include count of items + +```yaml +Type: SwitchParameter +Parameter Sets: List +Aliases: + +Required: False +Position: Named +Default value: False +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Expand +Expand related entities + +```yaml +Type: String[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Filter +Filter items by property values + +```yaml +Type: String +Parameter Sets: List +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Orderby +Order items by property values + +```yaml +Type: String[] +Parameter Sets: List +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Search +Search items by search phrases + +```yaml +Type: String +Parameter Sets: List +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Select +Select properties to be returned + +```yaml +Type: String[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ServicePrincipalId +key: id of servicePrincipal + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Skip +Ignores the first 'n' objects and then gets the remaining objects. + +```yaml +Type: UInt64 +Parameter Sets: List +Aliases: + +Required: False +Position: Named +Default value: 0 +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -First +Gets only the first 'n' objects. + +```yaml +Type: UInt64 +Parameter Sets: List +Aliases: + +Required: False +Position: Named +Default value: 0 +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRoleAssignment +## NOTES + +## RELATED LINKS + +[https://learn.microsoft.com/powershell/module/az.resources/get-azadserviceprincipalapproleassignment](https://learn.microsoft.com/powershell/module/az.resources/get-azadserviceprincipalapproleassignment) + diff --git a/src/Resources/Resources/help/Get-AzADSpCredential.md b/src/Resources/Resources/help/Get-AzADSpCredential.md index 7ea3fe53033b..1d191a43bf3d 100644 --- a/src/Resources/Resources/help/Get-AzADSpCredential.md +++ b/src/Resources/Resources/help/Get-AzADSpCredential.md @@ -453,3 +453,6 @@ SERVICEPRINCIPALOBJECT : The service principal ## RELATED LINKS ## RELATED LINKS + + +## RELATED LINKS diff --git a/src/Resources/Resources/help/Get-AzDeploymentWhatIfResult.md b/src/Resources/Resources/help/Get-AzDeploymentWhatIfResult.md index e1d25d694fe5..a6401f806419 100644 --- a/src/Resources/Resources/help/Get-AzDeploymentWhatIfResult.md +++ b/src/Resources/Resources/help/Get-AzDeploymentWhatIfResult.md @@ -75,6 +75,13 @@ Get-AzDeploymentWhatIfResult [-Name ] -Location [-ResultFormat [-SkipTemplateParameterPrompt] [-Pre] [-DefaultProfile ] [] ``` +### ByParameterFileWithNoTemplate +``` +Get-AzDeploymentWhatIfResult [-Name ] -Location [-ResultFormat ] + [-ExcludeChangeType ] -TemplateParameterFile [-SkipTemplateParameterPrompt] [-Pre] + [-DefaultProfile ] [] +``` + ### ByTemplateObjectAndParameterUri ``` Get-AzDeploymentWhatIfResult [-Name ] -Location [-ResultFormat ] @@ -124,13 +131,6 @@ Get-AzDeploymentWhatIfResult [-Name ] -Location [-ResultFormat [-DefaultProfile ] [] ``` -### ByParameterFileWithNoTemplate -``` -Get-AzDeploymentWhatIfResult [-Name ] -Location [-ResultFormat ] - [-ExcludeChangeType ] -TemplateParameterFile [-SkipTemplateParameterPrompt] [-Pre] - [-DefaultProfile ] [] -``` - ## DESCRIPTION The **Get-AzDeploymentWhatIfResult** cmdlet gets the ARM template What-If result for a template deployment at the current subscription scope. It returns a list of changes indicating what resources will be updated if the deployment is applied without making any changes to real resources. To specify the format for the returning result, use the *ResultFormat* parameter. diff --git a/src/Resources/Resources/help/Get-AzManagementGroupDeploymentWhatIfResult.md b/src/Resources/Resources/help/Get-AzManagementGroupDeploymentWhatIfResult.md index 148384e6f203..86c92cb41f4e 100644 --- a/src/Resources/Resources/help/Get-AzManagementGroupDeploymentWhatIfResult.md +++ b/src/Resources/Resources/help/Get-AzManagementGroupDeploymentWhatIfResult.md @@ -83,6 +83,13 @@ Get-AzManagementGroupDeploymentWhatIfResult [-Name ] -ManagementGroupId [] ``` +### ByParameterFileWithNoTemplate +``` +Get-AzManagementGroupDeploymentWhatIfResult [-Name ] -ManagementGroupId -Location + [-ResultFormat ] [-ExcludeChangeType ] -TemplateParameterFile + [-SkipTemplateParameterPrompt] [-Pre] [-DefaultProfile ] [] +``` + ### ByTemplateObjectAndParameterUri ``` Get-AzManagementGroupDeploymentWhatIfResult [-Name ] -ManagementGroupId -Location @@ -136,13 +143,6 @@ Get-AzManagementGroupDeploymentWhatIfResult [-Name ] -ManagementGroupId [-SkipTemplateParameterPrompt] [-Pre] [-DefaultProfile ] [] ``` -### ByParameterFileWithNoTemplate -``` -Get-AzManagementGroupDeploymentWhatIfResult [-Name ] -ManagementGroupId -Location - [-ResultFormat ] [-ExcludeChangeType ] -TemplateParameterFile - [-SkipTemplateParameterPrompt] [-Pre] [-DefaultProfile ] [] -``` - ## DESCRIPTION The **Get-AzManagementGroupDeploymentWhatIfResult** cmdlet gets the ARM template What-If result for a template deployment at the specified management group scope. It returns a list of changes indicating what resources will be updated if the deployment is applied without making any changes to real resources. To specify the format for the returning result, use the *ResultFormat* parameter. diff --git a/src/Resources/Resources/help/Get-AzResourceGroupDeploymentWhatIfResult.md b/src/Resources/Resources/help/Get-AzResourceGroupDeploymentWhatIfResult.md index d350610b59d7..97f53a280eb8 100644 --- a/src/Resources/Resources/help/Get-AzResourceGroupDeploymentWhatIfResult.md +++ b/src/Resources/Resources/help/Get-AzResourceGroupDeploymentWhatIfResult.md @@ -83,6 +83,13 @@ Get-AzResourceGroupDeploymentWhatIfResult [-Name ] -ResourceGroupName ] ``` +### ByParameterFileWithNoTemplate +``` +Get-AzResourceGroupDeploymentWhatIfResult [-Name ] -ResourceGroupName [-Mode ] + [-ResultFormat ] [-ExcludeChangeType ] -TemplateParameterFile + [-SkipTemplateParameterPrompt] [-Pre] [-DefaultProfile ] [] +``` + ### ByTemplateObjectAndParameterUri ``` Get-AzResourceGroupDeploymentWhatIfResult [-Name ] -ResourceGroupName [-Mode ] @@ -136,13 +143,6 @@ Get-AzResourceGroupDeploymentWhatIfResult [-Name ] -ResourceGroupName ] [] ``` -### ByParameterFileWithNoTemplate -``` -Get-AzResourceGroupDeploymentWhatIfResult [-Name ] -ResourceGroupName [-Mode ] - [-ResultFormat ] [-ExcludeChangeType ] -TemplateParameterFile - [-SkipTemplateParameterPrompt] [-Pre] [-DefaultProfile ] [] -``` - ## DESCRIPTION The **Get-AzResourceGroupDeploymentWhatIfResult** cmdlet gets the ARM template What-If result for a template deployment at the specified resource group scope. It returns a list of changes indicating what resources will be updated if the deployment is applied without making any changes to real resources. To specify the format for the returning result, use the *ResultFormat* parameter. diff --git a/src/Resources/Resources/help/Get-AzTenantDeploymentWhatIfResult.md b/src/Resources/Resources/help/Get-AzTenantDeploymentWhatIfResult.md index 9c9d8b2d6bae..53301a3088d8 100644 --- a/src/Resources/Resources/help/Get-AzTenantDeploymentWhatIfResult.md +++ b/src/Resources/Resources/help/Get-AzTenantDeploymentWhatIfResult.md @@ -75,6 +75,13 @@ Get-AzTenantDeploymentWhatIfResult [-Name ] -Location [-ResultF [-SkipTemplateParameterPrompt] [-Pre] [-DefaultProfile ] [] ``` +### ByParameterFileWithNoTemplate +``` +Get-AzTenantDeploymentWhatIfResult [-Name ] -Location [-ResultFormat ] + [-ExcludeChangeType ] -TemplateParameterFile [-SkipTemplateParameterPrompt] [-Pre] + [-DefaultProfile ] [] +``` + ### ByTemplateObjectAndParameterUri ``` Get-AzTenantDeploymentWhatIfResult [-Name ] -Location [-ResultFormat ] @@ -124,13 +131,6 @@ Get-AzTenantDeploymentWhatIfResult [-Name ] -Location [-ResultF [-DefaultProfile ] [] ``` -### ByParameterFileWithNoTemplate -``` -Get-AzTenantDeploymentWhatIfResult [-Name ] -Location [-ResultFormat ] - [-ExcludeChangeType ] -TemplateParameterFile [-SkipTemplateParameterPrompt] [-Pre] - [-DefaultProfile ] [] -``` - ## DESCRIPTION The **Get-AzTenantDeploymentWhatIfResult** cmdlet gets the ARM template What-If result for a template deployment at the specified tenant scope. It returns a list of changes indicating what resources will be updated if the deployment is applied without making any changes to real resources. To specify the format for the returning result, use the *ResultFormat* parameter. diff --git a/src/Resources/Resources/help/New-AzADAppCredential.md b/src/Resources/Resources/help/New-AzADAppCredential.md index 378784346550..75dc19bd8c15 100644 --- a/src/Resources/Resources/help/New-AzADAppCredential.md +++ b/src/Resources/Resources/help/New-AzADAppCredential.md @@ -636,3 +636,6 @@ PASSWORDCREDENTIALS : Password credentials a ## RELATED LINKS ## RELATED LINKS + + +## RELATED LINKS diff --git a/src/Resources/Resources/help/New-AzADApplication.md b/src/Resources/Resources/help/New-AzADApplication.md index d57857cbcacb..885ef009d733 100644 --- a/src/Resources/Resources/help/New-AzADApplication.md +++ b/src/Resources/Resources/help/New-AzADApplication.md @@ -1507,3 +1507,6 @@ WEB : webApplication ## RELATED LINKS ## RELATED LINKS + + +## RELATED LINKS diff --git a/src/Resources/Resources/help/New-AzADServicePrincipal.md b/src/Resources/Resources/help/New-AzADServicePrincipal.md index 8e30243b1fd3..1a477c17ed1c 100644 --- a/src/Resources/Resources/help/New-AzADServicePrincipal.md +++ b/src/Resources/Resources/help/New-AzADServicePrincipal.md @@ -2164,3 +2164,6 @@ TRANSITIVEMEMBEROF : . ## RELATED LINKS ## RELATED LINKS + + +## RELATED LINKS diff --git a/src/Resources/Resources/help/New-AzADServicePrincipalAppRoleAssignment.md b/src/Resources/Resources/help/New-AzADServicePrincipalAppRoleAssignment.md new file mode 100644 index 000000000000..13308644137f --- /dev/null +++ b/src/Resources/Resources/help/New-AzADServicePrincipalAppRoleAssignment.md @@ -0,0 +1,217 @@ +--- +external help file: Az.Resources-help.xml +Module Name: Az.Resources +online version: https://learn.microsoft.com/powershell/module/az.resources/new-azadserviceprincipalapproleassignment +schema: 2.0.0 +--- + +# New-AzADServicePrincipalAppRoleAssignment + +## SYNOPSIS +Create new navigation property to appRoleAssignments for servicePrincipals + +## SYNTAX + +### ObjectIdWithResourceIdParameterSet (Default) +``` +New-AzADServicePrincipalAppRoleAssignment -ServicePrincipalId -ResourceId + [-AdditionalProperties ] [-AppRoleId ] [-DefaultProfile ] [-WhatIf] [-Confirm] + [] +``` + +### ObjectIdWithResourceDisplayNameParameterSet +``` +New-AzADServicePrincipalAppRoleAssignment -ServicePrincipalId [-AdditionalProperties ] + [-AppRoleId ] -ResourceDisplayName [-DefaultProfile ] [-WhatIf] [-Confirm] + [] +``` + +### SPNWithResourceIdParameterSet +``` +New-AzADServicePrincipalAppRoleAssignment -ResourceId [-AdditionalProperties ] + [-AppRoleId ] -ServicePrincipalDisplayName [-DefaultProfile ] [-WhatIf] [-Confirm] + [] +``` + +### SPNWithResourceDisplayNameParameterSet +``` +New-AzADServicePrincipalAppRoleAssignment [-AdditionalProperties ] [-AppRoleId ] + -ResourceDisplayName -ServicePrincipalDisplayName [-DefaultProfile ] [-WhatIf] + [-Confirm] [] +``` + +## DESCRIPTION +Create new navigation property to appRoleAssignments for servicePrincipals + +## EXAMPLES + +### EXAMPLE 1 +``` +New-AzADServicePrincipalAppRoleAssignment -ServicePrincipalId 71beb965-8347-495d-a589-c21cdde7a722 -ResourceId 351fa797-c81a-4998-9720-4c2ecb6c7abc -AppRoleId 649ae968-bdf9-4f22-bb2c-2aa1b4af0a83 +``` + +### EXAMPLE 2 +``` +New-AzADServicePrincipalAppRoleAssignment -ServicePrincipalDisplayName funapp1214 -ResourceDisplayName nori-sp -AppRoleId 649ae968-bdf9-4f22-bb2c-2aa1b4af0a83 +``` + +## PARAMETERS + +### -AdditionalProperties +ParameterSetName='CreateExpanded')\] +Additional Parameters + +```yaml +Type: Hashtable +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AppRoleId +The identifier (id) for the app role which is assigned to the principal. +This app role must be exposed in the appRoles property on the resource application's service principal (resourceId). +If the resource application has not declared any app roles, a default app role ID of 00000000-0000-0000-0000-000000000000 can be specified to signal that the principal is assigned to the resource app without any specific app roles. +Required on create. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceDisplayName +The display name of the resource app's service principal to which the assignment is made. + +```yaml +Type: String +Parameter Sets: ObjectIdWithResourceDisplayNameParameterSet, SPNWithResourceDisplayNameParameterSet +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceId +The unique identifier (id) for the resource service principal for which the assignment is made. +Required on create. +Supports $filter (eq only). + +```yaml +Type: String +Parameter Sets: ObjectIdWithResourceIdParameterSet, SPNWithResourceIdParameterSet +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ServicePrincipalDisplayName +The name displayed in directory + +```yaml +Type: String +Parameter Sets: SPNWithResourceIdParameterSet, SPNWithResourceDisplayNameParameterSet +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ServicePrincipalId +The unique identifier (id) for the user, group or service principal being granted the app role. +Required on create. + +```yaml +Type: String +Parameter Sets: ObjectIdWithResourceIdParameterSet, ObjectIdWithResourceDisplayNameParameterSet +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRoleAssignment +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRoleAssignment +## NOTES + +## RELATED LINKS + +[https://learn.microsoft.com/powershell/module/az.resources/new-azadserviceprincipalapproleassignment](https://learn.microsoft.com/powershell/module/az.resources/new-azadserviceprincipalapproleassignment) + diff --git a/src/Resources/Resources/help/New-AzADSpCredential.md b/src/Resources/Resources/help/New-AzADSpCredential.md index da1bea21dd41..6430bf6d49da 100644 --- a/src/Resources/Resources/help/New-AzADSpCredential.md +++ b/src/Resources/Resources/help/New-AzADSpCredential.md @@ -602,3 +602,6 @@ SERVICEPRINCIPALOBJECT : The service principal ## RELATED LINKS ## RELATED LINKS + + +## RELATED LINKS diff --git a/src/Resources/Resources/help/New-AzDeployment.md b/src/Resources/Resources/help/New-AzDeployment.md index f50c4ac409aa..9eb7cee3d6c6 100644 --- a/src/Resources/Resources/help/New-AzDeployment.md +++ b/src/Resources/Resources/help/New-AzDeployment.md @@ -90,6 +90,14 @@ New-AzDeployment [-Name ] -Location [-DeploymentDebugLogLevel < [] ``` +### ByParameterFileWithNoTemplate +``` +New-AzDeployment [-Name ] -Location [-DeploymentDebugLogLevel ] [-Tag ] + [-WhatIfResultFormat ] [-WhatIfExcludeChangeType ] [-ProceedIfNoChange] [-AsJob] + [-QueryString ] -TemplateParameterFile [-SkipTemplateParameterPrompt] [-Pre] + [-DefaultProfile ] [-WhatIf] [-Confirm] [] +``` + ### ByTemplateObjectAndParameterUri ``` New-AzDeployment [-Name ] -Location [-DeploymentDebugLogLevel ] [-Tag ] @@ -147,14 +155,6 @@ New-AzDeployment [-Name ] -Location [-DeploymentDebugLogLevel < [-DefaultProfile ] [-WhatIf] [-Confirm] [] ``` -### ByParameterFileWithNoTemplate -``` -New-AzDeployment [-Name ] -Location [-DeploymentDebugLogLevel ] [-Tag ] - [-WhatIfResultFormat ] [-WhatIfExcludeChangeType ] [-ProceedIfNoChange] [-AsJob] - [-QueryString ] -TemplateParameterFile [-SkipTemplateParameterPrompt] [-Pre] - [-DefaultProfile ] [-WhatIf] [-Confirm] [] -``` - ## DESCRIPTION The **New-AzDeployment** cmdlet adds a deployment at the current subscription scope. This includes the resources that the deployment requires. diff --git a/src/Resources/Resources/help/New-AzManagementGroupDeployment.md b/src/Resources/Resources/help/New-AzManagementGroupDeployment.md index 9ae217c0bc2f..6fe8bf81fcd7 100644 --- a/src/Resources/Resources/help/New-AzManagementGroupDeployment.md +++ b/src/Resources/Resources/help/New-AzManagementGroupDeployment.md @@ -93,6 +93,15 @@ New-AzManagementGroupDeployment [-Name ] -ManagementGroupId -Lo [-DefaultProfile ] [-WhatIf] [-Confirm] [] ``` +### ByParameterFileWithNoTemplate +``` +New-AzManagementGroupDeployment [-Name ] -ManagementGroupId -Location + [-DeploymentDebugLogLevel ] [-Tag ] [-WhatIfResultFormat ] + [-WhatIfExcludeChangeType ] [-ProceedIfNoChange] [-AsJob] [-QueryString ] + -TemplateParameterFile [-SkipTemplateParameterPrompt] [-Pre] + [-DefaultProfile ] [-WhatIf] [-Confirm] [] +``` + ### ByTemplateObjectAndParameterUri ``` New-AzManagementGroupDeployment [-Name ] -ManagementGroupId -Location @@ -156,15 +165,6 @@ New-AzManagementGroupDeployment [-Name ] -ManagementGroupId -Lo [-WhatIf] [-Confirm] [] ``` -### ByParameterFileWithNoTemplate -``` -New-AzManagementGroupDeployment [-Name ] -ManagementGroupId -Location - [-DeploymentDebugLogLevel ] [-Tag ] [-WhatIfResultFormat ] - [-WhatIfExcludeChangeType ] [-ProceedIfNoChange] [-AsJob] [-QueryString ] - -TemplateParameterFile [-SkipTemplateParameterPrompt] [-Pre] [-DefaultProfile ] - [-WhatIf] [-Confirm] [] -``` - ## DESCRIPTION The **New-AzManagementGroupDeployment** cmdlet adds a deployment at a management group. diff --git a/src/Resources/Resources/help/New-AzResourceGroupDeployment.md b/src/Resources/Resources/help/New-AzResourceGroupDeployment.md index b659eb11d4b3..ef1250394a49 100644 --- a/src/Resources/Resources/help/New-AzResourceGroupDeployment.md +++ b/src/Resources/Resources/help/New-AzResourceGroupDeployment.md @@ -102,6 +102,16 @@ New-AzResourceGroupDeployment [-Name ] -ResourceGroupName [-Mod [] ``` +### ByParameterFileWithNoTemplate +``` +New-AzResourceGroupDeployment [-Name ] -ResourceGroupName [-Mode ] + [-DeploymentDebugLogLevel ] [-RollbackToLastDeployment] [-RollBackDeploymentName ] + [-Tag ] [-WhatIfResultFormat ] [-WhatIfExcludeChangeType ] [-Force] + [-ProceedIfNoChange] [-AsJob] [-QueryString ] -TemplateParameterFile + [-SkipTemplateParameterPrompt] [-Pre] [-DefaultProfile ] [-WhatIf] [-Confirm] + [] +``` + ### ByTemplateObjectAndParameterUri ``` New-AzResourceGroupDeployment [-Name ] -ResourceGroupName [-Mode ] @@ -170,15 +180,6 @@ New-AzResourceGroupDeployment [-Name ] -ResourceGroupName [-Mod [-Pre] [-DefaultProfile ] [-WhatIf] [-Confirm] [] ``` -### ByParameterFileWithNoTemplate -``` -New-AzResourceGroupDeployment [-Name ] -ResourceGroupName [-Mode ] - [-DeploymentDebugLogLevel ] [-RollbackToLastDeployment] [-RollBackDeploymentName ] - [-Tag ] [-WhatIfResultFormat ] [-WhatIfExcludeChangeType ] [-Force] - [-ProceedIfNoChange] [-AsJob] [-QueryString ] -TemplateParameterFile [-SkipTemplateParameterPrompt] - [-Pre] [-DefaultProfile ] [-WhatIf] [-Confirm] [] -``` - ## DESCRIPTION The **New-AzResourceGroupDeployment** cmdlet adds a deployment to an existing resource group. This includes the resources that the deployment requires. diff --git a/src/Resources/Resources/help/New-AzRoleDefinition.md b/src/Resources/Resources/help/New-AzRoleDefinition.md index 717e7c4ca19b..0091a3eaab03 100644 --- a/src/Resources/Resources/help/New-AzRoleDefinition.md +++ b/src/Resources/Resources/help/New-AzRoleDefinition.md @@ -101,7 +101,7 @@ $role.Actions = @( "Microsoft.Support/*" ) -New-AzRoleDefinition -Role $role +New-AzRoleDefinition -Role $role ``` ### Example 2: Create using JSON file diff --git a/src/Resources/Resources/help/New-AzTenantDeployment.md b/src/Resources/Resources/help/New-AzTenantDeployment.md index 8e13897c60b0..a96ed9bcb926 100644 --- a/src/Resources/Resources/help/New-AzTenantDeployment.md +++ b/src/Resources/Resources/help/New-AzTenantDeployment.md @@ -92,6 +92,15 @@ New-AzTenantDeployment [-Name ] -Location [-DeploymentDebugLogL [] ``` +### ByParameterFileWithNoTemplate +``` +New-AzTenantDeployment [-Name ] -Location [-DeploymentDebugLogLevel ] + [-Tag ] [-WhatIfResultFormat ] [-WhatIfExcludeChangeType ] + [-ProceedIfNoChange] [-AsJob] [-QueryString ] -TemplateParameterFile + [-SkipTemplateParameterPrompt] [-Pre] [-DefaultProfile ] [-WhatIf] [-Confirm] + [] +``` + ### ByTemplateObjectAndParameterUri ``` New-AzTenantDeployment [-Name ] -Location [-DeploymentDebugLogLevel ] @@ -153,14 +162,6 @@ New-AzTenantDeployment [-Name ] -Location [-DeploymentDebugLogL [-Pre] [-DefaultProfile ] [-WhatIf] [-Confirm] [] ``` -### ByParameterFileWithNoTemplate -``` -New-AzTenantDeployment [-Name ] -Location [-DeploymentDebugLogLevel ] - [-Tag ] [-WhatIfResultFormat ] [-WhatIfExcludeChangeType ] - [-ProceedIfNoChange] [-AsJob] [-QueryString ] -TemplateParameterFile [-SkipTemplateParameterPrompt] - [-Pre] [-DefaultProfile ] [-WhatIf] [-Confirm] [] -``` - ## DESCRIPTION The **New-AzTenantDeployment** cmdlet adds a deployment at the current tenant scope. diff --git a/src/Resources/Resources/help/Remove-AzADAppCredential.md b/src/Resources/Resources/help/Remove-AzADAppCredential.md index 7176543f780e..8b6b879382ca 100644 --- a/src/Resources/Resources/help/Remove-AzADAppCredential.md +++ b/src/Resources/Resources/help/Remove-AzADAppCredential.md @@ -461,3 +461,6 @@ APPLICATIONOBJECT : The application object, could be ## RELATED LINKS ## RELATED LINKS + + +## RELATED LINKS diff --git a/src/Resources/Resources/help/Remove-AzADApplication.md b/src/Resources/Resources/help/Remove-AzADApplication.md index bc4a626bd981..cb71663477d7 100644 --- a/src/Resources/Resources/help/Remove-AzADApplication.md +++ b/src/Resources/Resources/help/Remove-AzADApplication.md @@ -446,3 +446,6 @@ INPUTOBJECT : The application object, could be used ## RELATED LINKS ## RELATED LINKS + + +## RELATED LINKS diff --git a/src/Resources/Resources/help/Remove-AzADGroup.md b/src/Resources/Resources/help/Remove-AzADGroup.md index bef98677212d..e285bece0d2f 100644 --- a/src/Resources/Resources/help/Remove-AzADGroup.md +++ b/src/Resources/Resources/help/Remove-AzADGroup.md @@ -524,3 +524,6 @@ INPUTOBJECT : user input object ## RELATED LINKS ## RELATED LINKS + + +## RELATED LINKS diff --git a/src/Resources/Resources/help/Remove-AzADGroupMember.md b/src/Resources/Resources/help/Remove-AzADGroupMember.md index fa69c2df299d..705dad210c66 100644 --- a/src/Resources/Resources/help/Remove-AzADGroupMember.md +++ b/src/Resources/Resources/help/Remove-AzADGroupMember.md @@ -566,3 +566,6 @@ GROUPOBJECT : The target group object, could be used as pip ## RELATED LINKS ## RELATED LINKS + + +## RELATED LINKS diff --git a/src/Resources/Resources/help/Remove-AzADServicePrincipal.md b/src/Resources/Resources/help/Remove-AzADServicePrincipal.md index 1d8c4cdcd743..53d4a1347a60 100644 --- a/src/Resources/Resources/help/Remove-AzADServicePrincipal.md +++ b/src/Resources/Resources/help/Remove-AzADServicePrincipal.md @@ -776,3 +776,6 @@ INPUTOBJECT : key: service principal object ## RELATED LINKS ## RELATED LINKS + + +## RELATED LINKS diff --git a/src/Resources/Resources/help/Remove-AzADServicePrincipalAppRoleAssignment.md b/src/Resources/Resources/help/Remove-AzADServicePrincipalAppRoleAssignment.md new file mode 100644 index 000000000000..2e13e27ce269 --- /dev/null +++ b/src/Resources/Resources/help/Remove-AzADServicePrincipalAppRoleAssignment.md @@ -0,0 +1,151 @@ +--- +external help file: Az.Resources-help.xml +Module Name: Az.Resources +online version: https://learn.microsoft.com/powershell/module/az.resources/remove-azadserviceprincipalapproleassignment +schema: 2.0.0 +--- + +# Remove-AzADServicePrincipalAppRoleAssignment + +## SYNOPSIS +Delete navigation property appRoleAssignments for servicePrincipals + +## SYNTAX + +``` +Remove-AzADServicePrincipalAppRoleAssignment -AppRoleAssignmentId -ServicePrincipalId + [-IfMatch ] [-DefaultProfile ] [-PassThru] [-WhatIf] [-Confirm] [] +``` + +## DESCRIPTION +Delete navigation property appRoleAssignments for servicePrincipals + +## EXAMPLES + +### EXAMPLE 1 +``` +Remove-AzADServicePrincipalAppRoleAssignment -AppRoleAssignmentId Zbm-cUeDXUmlicIc3eenIlTWN1A5UVFMigS0D3ED-dk -ServicePrincipalId 71beb965-8347-495d-a589-c21cdde7a722 +``` + +## PARAMETERS + +### -AppRoleAssignmentId +key: id of appRoleAssignment + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -IfMatch +ETag + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: False +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ServicePrincipalId +key: id of servicePrincipal + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### System.Boolean +## NOTES + +## RELATED LINKS + +[https://learn.microsoft.com/powershell/module/az.resources/remove-azadserviceprincipalapproleassignment](https://learn.microsoft.com/powershell/module/az.resources/remove-azadserviceprincipalapproleassignment) + diff --git a/src/Resources/Resources/help/Remove-AzADSpCredential.md b/src/Resources/Resources/help/Remove-AzADSpCredential.md index b75e86fbfdf9..1a71faa4fc5a 100644 --- a/src/Resources/Resources/help/Remove-AzADSpCredential.md +++ b/src/Resources/Resources/help/Remove-AzADSpCredential.md @@ -489,3 +489,6 @@ SERVICEPRINCIPALOBJECT : The service principal ## RELATED LINKS ## RELATED LINKS + + +## RELATED LINKS diff --git a/src/Resources/Resources/help/Remove-AzADUser.md b/src/Resources/Resources/help/Remove-AzADUser.md index 5d18411021ed..dafd71eabdb2 100644 --- a/src/Resources/Resources/help/Remove-AzADUser.md +++ b/src/Resources/Resources/help/Remove-AzADUser.md @@ -638,3 +638,6 @@ INPUTOBJECT : user input object ## RELATED LINKS ## RELATED LINKS + + +## RELATED LINKS diff --git a/src/Resources/Resources/help/Test-AzDeployment.md b/src/Resources/Resources/help/Test-AzDeployment.md index de959d02ba66..154b7af82969 100644 --- a/src/Resources/Resources/help/Test-AzDeployment.md +++ b/src/Resources/Resources/help/Test-AzDeployment.md @@ -74,6 +74,12 @@ Test-AzDeployment [-Name ] -Location [-QueryString ] -T [] ``` +### ByParameterFileWithNoTemplate +``` +Test-AzDeployment [-Name ] -Location [-QueryString ] -TemplateParameterFile + [-SkipTemplateParameterPrompt] [-Pre] [-DefaultProfile ] [] +``` + ### ByTemplateObjectAndParameterUri ``` Test-AzDeployment [-Name ] -Location [-QueryString ] -TemplateParameterUri @@ -120,12 +126,6 @@ Test-AzDeployment [-Name ] -Location [-QueryString ] -T [-SkipTemplateParameterPrompt] [-Pre] [-DefaultProfile ] [] ``` -### ByParameterFileWithNoTemplate -``` -Test-AzDeployment [-Name ] -Location [-QueryString ] -TemplateParameterFile - [-SkipTemplateParameterPrompt] [-Pre] [-DefaultProfile ] [] -``` - ## DESCRIPTION The **Test-AzDeployment** cmdlet determines whether a deployment template and its parameter values are valid. diff --git a/src/Resources/Resources/help/Test-AzManagementGroupDeployment.md b/src/Resources/Resources/help/Test-AzManagementGroupDeployment.md index b5f10a12664c..6a4bd45ccfef 100644 --- a/src/Resources/Resources/help/Test-AzManagementGroupDeployment.md +++ b/src/Resources/Resources/help/Test-AzManagementGroupDeployment.md @@ -75,6 +75,13 @@ Test-AzManagementGroupDeployment [-Name ] -ManagementGroupId -L [-SkipTemplateParameterPrompt] [-Pre] [-DefaultProfile ] [] ``` +### ByParameterFileWithNoTemplate +``` +Test-AzManagementGroupDeployment [-Name ] -ManagementGroupId -Location + [-QueryString ] -TemplateParameterFile [-SkipTemplateParameterPrompt] [-Pre] + [-DefaultProfile ] [] +``` + ### ByTemplateObjectAndParameterUri ``` Test-AzManagementGroupDeployment [-Name ] -ManagementGroupId -Location @@ -124,13 +131,6 @@ Test-AzManagementGroupDeployment [-Name ] -ManagementGroupId -L [-DefaultProfile ] [] ``` -### ByParameterFileWithNoTemplate -``` -Test-AzManagementGroupDeployment [-Name ] -ManagementGroupId -Location - [-QueryString ] -TemplateParameterFile [-SkipTemplateParameterPrompt] [-Pre] - [-DefaultProfile ] [] -``` - ## DESCRIPTION The **Test-AzManagementGroupDeployment** cmdlet determines whether a deployment template and its parameter values are valid at a management group. diff --git a/src/Resources/Resources/help/Test-AzResourceGroupDeployment.md b/src/Resources/Resources/help/Test-AzResourceGroupDeployment.md index 9c16e39f3be0..3f5c59b644b0 100644 --- a/src/Resources/Resources/help/Test-AzResourceGroupDeployment.md +++ b/src/Resources/Resources/help/Test-AzResourceGroupDeployment.md @@ -84,6 +84,13 @@ Test-AzResourceGroupDeployment -ResourceGroupName [-Mode ] ``` +### ByParameterFileWithNoTemplate +``` +Test-AzResourceGroupDeployment -ResourceGroupName [-Mode ] [-RollbackToLastDeployment] + [-RollBackDeploymentName ] [-QueryString ] -TemplateParameterFile + [-SkipTemplateParameterPrompt] [-Pre] [-DefaultProfile ] [] +``` + ### ByTemplateObjectAndParameterUri ``` Test-AzResourceGroupDeployment -ResourceGroupName [-Mode ] [-RollbackToLastDeployment] @@ -137,13 +144,6 @@ Test-AzResourceGroupDeployment -ResourceGroupName [-Mode ] [] ``` -### ByParameterFileWithNoTemplate -``` -Test-AzResourceGroupDeployment -ResourceGroupName [-Mode ] [-RollbackToLastDeployment] - [-RollBackDeploymentName ] [-QueryString ] -TemplateParameterFile - [-SkipTemplateParameterPrompt] [-Pre] [-DefaultProfile ] [] -``` - ## DESCRIPTION The **Test-AzResourceGroupDeployment** cmdlet determines whether an Azure resource group deployment template and its parameter values are valid. diff --git a/src/Resources/Resources/help/Test-AzTenantDeployment.md b/src/Resources/Resources/help/Test-AzTenantDeployment.md index 7b7fc5c8c8d5..436417ed74f8 100644 --- a/src/Resources/Resources/help/Test-AzTenantDeployment.md +++ b/src/Resources/Resources/help/Test-AzTenantDeployment.md @@ -74,6 +74,13 @@ Test-AzTenantDeployment [-Name ] -Location [-QueryString ] [] ``` +### ByParameterFileWithNoTemplate +``` +Test-AzTenantDeployment [-Name ] -Location [-QueryString ] + -TemplateParameterFile [-SkipTemplateParameterPrompt] [-Pre] + [-DefaultProfile ] [] +``` + ### ByTemplateObjectAndParameterUri ``` Test-AzTenantDeployment [-Name ] -Location [-QueryString ] @@ -120,12 +127,6 @@ Test-AzTenantDeployment [-Name ] -Location [-QueryString ] [] ``` -### ByParameterFileWithNoTemplate -``` -Test-AzTenantDeployment [-Name ] -Location [-QueryString ] -TemplateParameterFile - [-SkipTemplateParameterPrompt] [-Pre] [-DefaultProfile ] [] -``` - ## DESCRIPTION The **Test-AzTenantDeployment** cmdlet determines whether a deployment template and its parameter values are valid at the current tenant scope. diff --git a/src/Resources/Resources/help/Update-AzADApplication.md b/src/Resources/Resources/help/Update-AzADApplication.md index 925c12757622..d7fcb26bd205 100644 --- a/src/Resources/Resources/help/Update-AzADApplication.md +++ b/src/Resources/Resources/help/Update-AzADApplication.md @@ -1689,3 +1689,6 @@ WEB : webApplication ## RELATED LINKS ## RELATED LINKS + + +## RELATED LINKS diff --git a/src/Resources/Resources/help/Update-AzADServicePrincipal.md b/src/Resources/Resources/help/Update-AzADServicePrincipal.md index fa023102fcc6..cc08829304f0 100644 --- a/src/Resources/Resources/help/Update-AzADServicePrincipal.md +++ b/src/Resources/Resources/help/Update-AzADServicePrincipal.md @@ -2102,3 +2102,6 @@ TRANSITIVEMEMBEROF : . ## RELATED LINKS ## RELATED LINKS + + +## RELATED LINKS diff --git a/src/Resources/Resources/help/Update-AzADServicePrincipalAppRoleAssignment.md b/src/Resources/Resources/help/Update-AzADServicePrincipalAppRoleAssignment.md new file mode 100644 index 000000000000..493efacce1e8 --- /dev/null +++ b/src/Resources/Resources/help/Update-AzADServicePrincipalAppRoleAssignment.md @@ -0,0 +1,216 @@ +--- +external help file: Az.Resources-help.xml +Module Name: Az.Resources +online version: https://learn.microsoft.com/powershell/module/az.resources/update-azadserviceprincipalapproleassignment +schema: 2.0.0 +--- + +# Update-AzADServicePrincipalAppRoleAssignment + +## SYNOPSIS +Update the navigation property appRoleAssignments in servicePrincipals + +## SYNTAX + +### UpdateExpanded (Default) +``` +Update-AzADServicePrincipalAppRoleAssignment -AppRoleAssignmentId -ServicePrincipalId + [-AdditionalProperties ] [-AppRoleId ] [-DefaultProfile ] [-PassThru] [-WhatIf] + [-Confirm] [] +``` + +### Update +``` +Update-AzADServicePrincipalAppRoleAssignment -AppRoleAssignmentId -ServicePrincipalId + -Body [-DefaultProfile ] [-PassThru] [-WhatIf] [-Confirm] + [] +``` + +## DESCRIPTION +Update the navigation property appRoleAssignments in servicePrincipals + +## EXAMPLES + +### EXAMPLE 1 +``` +Update-AzADServicePrincipalAppRoleAssignment -AppRoleAssignmentId Zbm-cUeDXUmlicIc3eenIoFW9pZ_gRBIudKgu0gaMIw -ServicePrincipalId 71beb965-8347-495d-a589-c21cdde7a722 -AppRoleId 649ae968-bdf9-4f22-bb2c-2aa1b4af0a83 +``` + +## PARAMETERS + +### -AdditionalProperties +Additional Parameters + +```yaml +Type: Hashtable +Parameter Sets: UpdateExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AppRoleAssignmentId +key: id of appRoleAssignment + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AppRoleId +The identifier (id) for the app role which is assigned to the principal. +This app role must be exposed in the appRoles property on the resource application's service principal (resourceId). +If the resource application has not declared any app roles, a default app role ID of 00000000-0000-0000-0000-000000000000 can be specified to signal that the principal is assigned to the resource app without any specific app roles. +Required on create. + +```yaml +Type: String +Parameter Sets: UpdateExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Body +Represents an Azure Active Directory object. +The directoryObject type is the base type for many other directory entity types. +To construct, see NOTES section for BODY properties and create a hash table. + +```yaml +Type: IMicrosoftGraphAppRoleAssignment +Parameter Sets: Update +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: False +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ServicePrincipalId +key: id of servicePrincipal + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRoleAssignment +## 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. + +BODY \: Represents an Azure Active Directory object. +The directoryObject type is the base type for many other directory entity types. + \[(Any) \\]: This indicates any property can be added to this object. + \[DeletedDateTime \\]: + \[DisplayName \\]: The name displayed in directory + \[AppRoleId \\]: The identifier (id) for the app role which is assigned to the principal. +This app role must be exposed in the appRoles property on the resource application's service principal (resourceId). +If the resource application has not declared any app roles, a default app role ID of 00000000-0000-0000-0000-000000000000 can be specified to signal that the principal is assigned to the resource app without any specific app roles. +Required on create. + \[PrincipalId \\]: The unique identifier (id) for the user, group or service principal being granted the app role. +Required on create. + \[ResourceDisplayName \\]: The display name of the resource app's service principal to which the assignment is made. + \[ResourceId \\]: The unique identifier (id) for the resource service principal for which the assignment is made. +Required on create. +Supports $filter (eq only). + +## RELATED LINKS + +[https://learn.microsoft.com/powershell/module/az.resources/update-azadserviceprincipalapproleassignment](https://learn.microsoft.com/powershell/module/az.resources/update-azadserviceprincipalapproleassignment) + diff --git a/src/Resources/Resources/help/Update-AzADUser.md b/src/Resources/Resources/help/Update-AzADUser.md index d78ecb8d7c3b..b217b00f6d5e 100644 --- a/src/Resources/Resources/help/Update-AzADUser.md +++ b/src/Resources/Resources/help/Update-AzADUser.md @@ -1299,3 +1299,6 @@ PASSWORDPROFILE : passwordProfile ## RELATED LINKS ## RELATED LINKS + + +## RELATED LINKS