From c2b91f8fe0a42683ffbf0c44daec6bd1a3174aad Mon Sep 17 00:00:00 2001 From: "azure-pipelines[bot]" <36771401+azure-pipelines[bot]@users.noreply.github.com> Date: Fri, 8 Nov 2024 23:18:44 +0800 Subject: [PATCH] Migrate Astro from generation to main (#26643) * Move Astro to main * Update ChangeLog.md --------- Co-authored-by: azure-powershell-bot <65331932+azure-powershell-bot@users.noreply.github.com> Co-authored-by: Vincent Dai <23257217+vidai-msft@users.noreply.github.com> --- src/Astro/Astro.Autorest/README.md | 4 + src/Astro/Astro.Autorest/build-module.ps1 | 7 +- .../custom/New-AzAstroOrganization.ps1 | 19 +- .../custom/Update-AzAstroOrganization.ps1 | 542 +++++++++--------- .../custom/UserAssignedIdentities.json.cs | 31 + .../Astro.Autorest/generate-portal-ux.ps1 | 9 + .../Astro.Autorest/generated/api/Astro.cs | 24 +- .../UserAssignedIdentities.dictionary.cs | 2 +- .../NewAzAstroOrganization_CreateExpanded.cs | 37 +- ...AstroOrganization_CreateViaJsonFilePath.cs | 4 +- ...AzAstroOrganization_CreateViaJsonString.cs | 4 +- ...pdateAzAstroOrganization_UpdateExpanded.cs | 37 +- ...oOrganization_UpdateViaIdentityExpanded.cs | 46 +- ...AstroOrganization_UpdateViaJsonFilePath.cs | 4 +- ...AzAstroOrganization_UpdateViaJsonString.cs | 4 +- .../internal/New-AzAstroOrganization.ps1 | 21 +- .../internal/ProxyCmdletDefinitions.ps1 | 44 +- .../internal/Update-AzAstroOrganization.ps1 | 23 +- src/Astro/Astro/Az.Astro.psd1 | 4 +- src/Astro/Astro/ChangeLog.md | 1 + .../Astro/help/Get-AzAstroOrganization.md | 23 +- .../Astro/help/New-AzAstroOrganization.md | 21 +- .../Astro/help/Remove-AzAstroOrganization.md | 19 +- .../Astro/help/Update-AzAstroOrganization.md | 23 +- 24 files changed, 542 insertions(+), 411 deletions(-) create mode 100644 src/Astro/Astro.Autorest/custom/UserAssignedIdentities.json.cs diff --git a/src/Astro/Astro.Autorest/README.md b/src/Astro/Astro.Autorest/README.md index 95350ac748e6..953565c076c3 100644 --- a/src/Astro/Astro.Autorest/README.md +++ b/src/Astro/Astro.Autorest/README.md @@ -48,6 +48,7 @@ subject-prefix: $(service-name) # Disable transform IdentityType as GET+PUT can not replace patch # 1. Organizations_CreateOrUpdate can not update resources # 2. the input schemas of PUT and PATCH are different +flatten-userassignedidentity: false disable-transform-identity-type: true directive: @@ -74,4 +75,7 @@ directive: - where: verb: Update hide: true + - from: UserAssignedIdentities.dictionary.cs + where: $ + transform: $ = $.replace('null != property.Key && null != property.Value', 'null != property.Key'); ``` diff --git a/src/Astro/Astro.Autorest/build-module.ps1 b/src/Astro/Astro.Autorest/build-module.ps1 index 7ae705382ce7..ad86127f2620 100644 --- a/src/Astro/Astro.Autorest/build-module.ps1 +++ b/src/Astro/Astro.Autorest/build-module.ps1 @@ -75,6 +75,8 @@ if(-not $NotIsolated -and -not $Debugger) { $binFolder = Join-Path $PSScriptRoot 'bin' $objFolder = Join-Path $PSScriptRoot 'obj' +$isAzure = [System.Convert]::ToBoolean('true') + if(-not $Debugger) { Write-Host -ForegroundColor Green 'Cleaning build folders...' $null = Remove-Item -Recurse -ErrorAction SilentlyContinue -Path $binFolder, $objFolder @@ -151,7 +153,7 @@ if($NoDocs) { $null = Get-ChildItem -Path $docsFolder -Recurse -Exclude 'README.md' | Remove-Item -Recurse -ErrorAction SilentlyContinue } $null = New-Item -ItemType Directory -Force -Path $docsFolder - $addComplexInterfaceInfo = ![System.Convert]::ToBoolean('true') + $addComplexInterfaceInfo = !$isAzure Export-ProxyCmdlet -ModuleName $moduleName -ModulePath $modulePaths -ExportsFolder $exportsFolder -InternalFolder $internalFolder -ModuleDescription $moduleDescription -DocsFolder $docsFolder -ExamplesFolder $examplesFolder -ModuleGuid $guid -AddComplexInterfaceInfo:$addComplexInterfaceInfo } @@ -186,5 +188,4 @@ if (-not $DisableAfterBuildTasks){ } } - -Write-Host -ForegroundColor Green '-------------Done-------------' +Write-Host -ForegroundColor Green '-------------Done-------------' \ No newline at end of file diff --git a/src/Astro/Astro.Autorest/custom/New-AzAstroOrganization.ps1 b/src/Astro/Astro.Autorest/custom/New-AzAstroOrganization.ps1 index 48ed9b4f7b39..07f835d95fce 100644 --- a/src/Astro/Astro.Autorest/custom/New-AzAstroOrganization.ps1 +++ b/src/Astro/Astro.Autorest/custom/New-AzAstroOrganization.ps1 @@ -100,7 +100,7 @@ function New-AzAstroOrganization { # Last name of the user ${UserLastName}, - [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName = 'CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Astro.Category('Body')] [System.Management.Automation.SwitchParameter] # Decides if enable a system assigned identity for the resource. @@ -282,7 +282,7 @@ function New-AzAstroOrganization { ) process { - if($PSBoundParameters.ContainsKey('EnableSystemAssignedIdentity') -or $PSBoundParameters.ContainsKey('UserAssignedIdentity') ){ + if ($PSBoundParameters.ContainsKey('EnableSystemAssignedIdentity') -or $PSBoundParameters.ContainsKey('UserAssignedIdentity')) { $supportsSystemAssignedIdentity = $PSBoundParameters.ContainsKey('EnableSystemAssignedIdentity') $supportsUserAssignedIdentity = $PSBoundParameters.ContainsKey("UserAssignedIdentity") -and $UserAssignedIdentity.Length -gt 0 @@ -299,9 +299,20 @@ function New-AzAstroOrganization { else { $PSBoundParameters.Add("IdentityType", "None") } - + + # If user input UserAssignedIdentity + if ($PSBoundParameters.ContainsKey('UserAssignedIdentity')) { + $userIdentityObject = [Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.UserAssignedIdentity]::New() + $PSBoundParameters.IdentityUserAssignedIdentity = @{} + foreach ($item in $PSBoundParameters.UserAssignedIdentity) { + $PSBoundParameters.IdentityUserAssignedIdentity.Add($item, $userIdentityObject ) + } + + $null = $PSBoundParameters.Remove('UserAssignedIdentity') + } + # remove EnableSystemAssignedIdentity - if($PSBoundParameters.ContainsKey('EnableSystemAssignedIdentity')) { + if ($PSBoundParameters.ContainsKey('EnableSystemAssignedIdentity')) { $null = $PSBoundParameters.Remove("EnableSystemAssignedIdentity") } } diff --git a/src/Astro/Astro.Autorest/custom/Update-AzAstroOrganization.ps1 b/src/Astro/Astro.Autorest/custom/Update-AzAstroOrganization.ps1 index 222d5d2e7213..b1c1fad9f111 100644 --- a/src/Astro/Astro.Autorest/custom/Update-AzAstroOrganization.ps1 +++ b/src/Astro/Astro.Autorest/custom/Update-AzAstroOrganization.ps1 @@ -40,266 +40,288 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.astro/update-azastroorganization #> function Update-AzAstroOrganization { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IOrganizationResource])] -[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] -param( - [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] - [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] - [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] - [Alias('OrganizationName')] - [Microsoft.Azure.PowerShell.Cmdlets.Astro.Category('Path')] - [System.String] - # Name of the Organizations resource - ${Name}, - - [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] - [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] - [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.Astro.Category('Path')] - [System.String] - # The name of the resource group. - # The name is case insensitive. - ${ResourceGroupName}, - - [Parameter(ParameterSetName='UpdateExpanded')] - [Parameter(ParameterSetName='UpdateViaJsonFilePath')] - [Parameter(ParameterSetName='UpdateViaJsonString')] - [Microsoft.Azure.PowerShell.Cmdlets.Astro.Category('Path')] - [Microsoft.Azure.PowerShell.Cmdlets.Astro.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] - [System.String] - # The ID of the target subscription. - ${SubscriptionId}, - - [Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory, ValueFromPipeline)] - [Microsoft.Azure.PowerShell.Cmdlets.Astro.Category('Path')] - [Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IAstroIdentity] - # Identity Parameter - ${InputObject}, - - [Parameter(ParameterSetName='UpdateExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] - [Microsoft.Azure.PowerShell.Cmdlets.Astro.Category('Body')] - [System.Nullable[System.Boolean]] - # Decides if enable a system assigned identity for the resource. - ${EnableSystemAssignedIdentity}, - - [Parameter(ParameterSetName='UpdateExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] - [Microsoft.Azure.PowerShell.Cmdlets.Astro.Category('Body')] - [System.String] - # Organization Id in partner's system - ${PartnerOrganizationPropertyOrganizationId}, - - [Parameter(ParameterSetName='UpdateExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] - [Microsoft.Azure.PowerShell.Cmdlets.Astro.Category('Body')] - [System.String] - # Organization name in partner's system - ${PartnerOrganizationPropertyOrganizationName}, - - [Parameter(ParameterSetName='UpdateExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] - [Microsoft.Azure.PowerShell.Cmdlets.Astro.Category('Body')] - [System.String] - # Workspace Id in partner's system - ${PartnerOrganizationPropertyWorkspaceId}, - - [Parameter(ParameterSetName='UpdateExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] - [Microsoft.Azure.PowerShell.Cmdlets.Astro.Category('Body')] - [System.String] - # Workspace name in partner's system - ${PartnerOrganizationPropertyWorkspaceName}, - - [Parameter(ParameterSetName='UpdateExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] - [AllowEmptyCollection()] - [Microsoft.Azure.PowerShell.Cmdlets.Astro.Category('Body')] - [System.String[]] - # List of AAD domains fetched from Microsoft Graph for user. - ${SingleSignOnPropertyAadDomain}, - - [Parameter(ParameterSetName='UpdateExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] - [Microsoft.Azure.PowerShell.Cmdlets.Astro.Category('Body')] - [System.String] - # AAD enterprise application Id used to setup SSO - ${SingleSignOnPropertyEnterpriseAppId}, - - [Parameter(ParameterSetName='UpdateExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] - [Microsoft.Azure.PowerShell.Cmdlets.Astro.PSArgumentCompleterAttribute("Initial", "Enable", "Disable")] - [Microsoft.Azure.PowerShell.Cmdlets.Astro.Category('Body')] - [System.String] - # State of the Single Sign On for the organization - ${SingleSignOnPropertySingleSignOnState}, - - [Parameter(ParameterSetName='UpdateExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] - [Microsoft.Azure.PowerShell.Cmdlets.Astro.Category('Body')] - [System.String] - # URL for SSO to be used by the partner to redirect the user to their system - ${SingleSignOnPropertySingleSignOnUrl}, - - [Parameter(ParameterSetName='UpdateExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] - [Microsoft.Azure.PowerShell.Cmdlets.Astro.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Astro.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IOrganizationResourceUpdateTags]))] - [System.Collections.Hashtable] - # Resource tags. - ${Tag}, - - [Parameter(ParameterSetName='UpdateExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] - [AllowEmptyCollection()] - [Microsoft.Azure.PowerShell.Cmdlets.Astro.Category('Body')] - [System.String[]] - # The array of user assigned identities associated with the resource. - # The elements in array will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}.' - ${UserAssignedIdentity}, - - [Parameter(ParameterSetName='UpdateExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] - [Microsoft.Azure.PowerShell.Cmdlets.Astro.Category('Body')] - [System.String] - # Email address of the user - ${UserEmailAddress}, - - [Parameter(ParameterSetName='UpdateExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] - [Microsoft.Azure.PowerShell.Cmdlets.Astro.Category('Body')] - [System.String] - # First name of the user - ${UserFirstName}, - - [Parameter(ParameterSetName='UpdateExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] - [Microsoft.Azure.PowerShell.Cmdlets.Astro.Category('Body')] - [System.String] - # Last name of the user - ${UserLastName}, - - [Parameter(ParameterSetName='UpdateExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] - [Microsoft.Azure.PowerShell.Cmdlets.Astro.Category('Body')] - [System.String] - # User's phone number - ${UserPhoneNumber}, - - [Parameter(ParameterSetName='UpdateExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] - [Microsoft.Azure.PowerShell.Cmdlets.Astro.Category('Body')] - [System.String] - # User's principal name - ${UserUpn}, - - [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.Astro.Category('Body')] - [System.String] - # Path of Json file supplied to the Update operation - ${JsonFilePath}, - - [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.Astro.Category('Body')] - [System.String] - # Json string supplied to the Update operation - ${JsonString}, - - [Parameter()] - [Alias('AzureRMContext', 'AzureCredential')] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.Astro.Category('Azure')] - [System.Management.Automation.PSObject] - # The DefaultProfile parameter is not functional. - # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. - ${DefaultProfile}, - - [Parameter()] - [Microsoft.Azure.PowerShell.Cmdlets.Astro.Category('Runtime')] - [System.Management.Automation.SwitchParameter] - # Run the command as a job - ${AsJob}, - - [Parameter(DontShow)] - [Microsoft.Azure.PowerShell.Cmdlets.Astro.Category('Runtime')] - [System.Management.Automation.SwitchParameter] - # Wait for .NET debugger to attach - ${Break}, - - [Parameter(DontShow)] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.Astro.Category('Runtime')] - [Microsoft.Azure.PowerShell.Cmdlets.Astro.Runtime.SendAsyncStep[]] - # SendAsync Pipeline Steps to be appended to the front of the pipeline - ${HttpPipelineAppend}, - - [Parameter(DontShow)] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.Astro.Category('Runtime')] - [Microsoft.Azure.PowerShell.Cmdlets.Astro.Runtime.SendAsyncStep[]] - # SendAsync Pipeline Steps to be prepended to the front of the pipeline - ${HttpPipelinePrepend}, - - [Parameter()] - [Microsoft.Azure.PowerShell.Cmdlets.Astro.Category('Runtime')] - [System.Management.Automation.SwitchParameter] - # Run the command asynchronously - ${NoWait}, - - [Parameter(DontShow)] - [Microsoft.Azure.PowerShell.Cmdlets.Astro.Category('Runtime')] - [System.Uri] - # The URI for the proxy server to use - ${Proxy}, - - [Parameter(DontShow)] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.Astro.Category('Runtime')] - [System.Management.Automation.PSCredential] - # Credentials for a proxy server to use for the remote call - ${ProxyCredential}, - - [Parameter(DontShow)] - [Microsoft.Azure.PowerShell.Cmdlets.Astro.Category('Runtime')] - [System.Management.Automation.SwitchParameter] - # Use the default credentials for the proxy - ${ProxyUseDefaultCredentials} -) - -process { - if($PSBoundParameters.ContainsKey('EnableSystemAssignedIdentity') -or $PSBoundParameters.ContainsKey('UserAssignedIdentity') ){ - # get existing organization - if(('UpdateExpanded') -contains $parameterSet){ - $organization = Az.Astro.exports\Get-AzAstroOrganization -Name $Name -ResourceGroupName $ResourceGroupName - }elseif(('UpdateViaIdentityExpanded') -contains $parameterSet) - { - $organization = Az.Astro.exports\Get-AzAstroOrganization -InputObject $InputObject - } - if($null -eq $organization) - { - throw "$Name doesn't exist" - } - # calculate IdentityType - $supportsSystemAssignedIdentity = $EnableSystemAssignedIdentity -or (($null -eq $EnableSystemAssignedIdentity) -and ($organization.IdentityType -Contains "SystemAssigned")) - $supportsUserAssignedIdentity = ($PSBoundParameters.ContainsKey('UserAssignedIdentity') -and $UserAssignedIdentity.Length -gt 0) -or ((-not $PSBoundParameters.ContainsKey('UserAssignedIdentity')) -and ($organization.IdentityType -Contains "UserAssigned")); - if (($supportsSystemAssignedIdentity -and $supportsUserAssignedIdentity)) { - $PSBoundParameters.Add("IdentityType", "SystemAssigned,UserAssigned") - } - elseif ($supportsUserAssignedIdentity -and (-not $supportsSystemAssignedIdentity)) { - $PSBoundParameters.Add("IdentityType", "UserAssigned") - } - elseif ((-not $supportsUserAssignedIdentity) -and $supportsSystemAssignedIdentity) { - $PSBoundParameters.Add("IdentityType", "SystemAssigned") - } - else { - $PSBoundParameters.Add("IdentityType", "None") - } - # remove EnableSystemAssignedIdentity - if($PSBoundParameters.ContainsKey('EnableSystemAssignedIdentity')) { - $null = $PSBoundParameters.Remove("EnableSystemAssignedIdentity") + [OutputType([Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IOrganizationResource])] + [CmdletBinding(DefaultParameterSetName = 'UpdateExpanded', PositionalBinding = $false, SupportsShouldProcess, ConfirmImpact = 'Medium')] + param( + [Parameter(ParameterSetName = 'UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName = 'UpdateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName = 'UpdateViaJsonString', Mandatory)] + [Alias('OrganizationName')] + [Microsoft.Azure.PowerShell.Cmdlets.Astro.Category('Path')] + [System.String] + # Name of the Organizations resource + ${Name}, + + [Parameter(ParameterSetName = 'UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName = 'UpdateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName = 'UpdateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Astro.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName = 'UpdateExpanded')] + [Parameter(ParameterSetName = 'UpdateViaJsonFilePath')] + [Parameter(ParameterSetName = 'UpdateViaJsonString')] + [Microsoft.Azure.PowerShell.Cmdlets.Astro.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Astro.Runtime.DefaultInfo(Script = '(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName = 'UpdateViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Astro.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IAstroIdentity] + # Identity Parameter + ${InputObject}, + + [Parameter(ParameterSetName = 'UpdateExpanded')] + [Parameter(ParameterSetName = 'UpdateViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Astro.Category('Body')] + [System.Nullable[System.Boolean]] + # Decides if enable a system assigned identity for the resource. + ${EnableSystemAssignedIdentity}, + + [Parameter(ParameterSetName = 'UpdateExpanded')] + [Parameter(ParameterSetName = 'UpdateViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Astro.Category('Body')] + [System.String] + # Organization Id in partner's system + ${PartnerOrganizationPropertyOrganizationId}, + + [Parameter(ParameterSetName = 'UpdateExpanded')] + [Parameter(ParameterSetName = 'UpdateViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Astro.Category('Body')] + [System.String] + # Organization name in partner's system + ${PartnerOrganizationPropertyOrganizationName}, + + [Parameter(ParameterSetName = 'UpdateExpanded')] + [Parameter(ParameterSetName = 'UpdateViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Astro.Category('Body')] + [System.String] + # Workspace Id in partner's system + ${PartnerOrganizationPropertyWorkspaceId}, + + [Parameter(ParameterSetName = 'UpdateExpanded')] + [Parameter(ParameterSetName = 'UpdateViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Astro.Category('Body')] + [System.String] + # Workspace name in partner's system + ${PartnerOrganizationPropertyWorkspaceName}, + + [Parameter(ParameterSetName = 'UpdateExpanded')] + [Parameter(ParameterSetName = 'UpdateViaIdentityExpanded')] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.Astro.Category('Body')] + [System.String[]] + # List of AAD domains fetched from Microsoft Graph for user. + ${SingleSignOnPropertyAadDomain}, + + [Parameter(ParameterSetName = 'UpdateExpanded')] + [Parameter(ParameterSetName = 'UpdateViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Astro.Category('Body')] + [System.String] + # AAD enterprise application Id used to setup SSO + ${SingleSignOnPropertyEnterpriseAppId}, + + [Parameter(ParameterSetName = 'UpdateExpanded')] + [Parameter(ParameterSetName = 'UpdateViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Astro.PSArgumentCompleterAttribute("Initial", "Enable", "Disable")] + [Microsoft.Azure.PowerShell.Cmdlets.Astro.Category('Body')] + [System.String] + # State of the Single Sign On for the organization + ${SingleSignOnPropertySingleSignOnState}, + + [Parameter(ParameterSetName = 'UpdateExpanded')] + [Parameter(ParameterSetName = 'UpdateViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Astro.Category('Body')] + [System.String] + # URL for SSO to be used by the partner to redirect the user to their system + ${SingleSignOnPropertySingleSignOnUrl}, + + [Parameter(ParameterSetName = 'UpdateExpanded')] + [Parameter(ParameterSetName = 'UpdateViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Astro.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Astro.Runtime.Info(PossibleTypes = ([Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IOrganizationResourceUpdateTags]))] + [System.Collections.Hashtable] + # Resource tags. + ${Tag}, + + [Parameter(ParameterSetName = 'UpdateExpanded')] + [Parameter(ParameterSetName = 'UpdateViaIdentityExpanded')] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.Astro.Category('Body')] + [System.String[]] + # The array of user assigned identities associated with the resource. + # The elements in array will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}.' + ${UserAssignedIdentity}, + + [Parameter(ParameterSetName = 'UpdateExpanded')] + [Parameter(ParameterSetName = 'UpdateViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Astro.Category('Body')] + [System.String] + # Email address of the user + ${UserEmailAddress}, + + [Parameter(ParameterSetName = 'UpdateExpanded')] + [Parameter(ParameterSetName = 'UpdateViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Astro.Category('Body')] + [System.String] + # First name of the user + ${UserFirstName}, + + [Parameter(ParameterSetName = 'UpdateExpanded')] + [Parameter(ParameterSetName = 'UpdateViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Astro.Category('Body')] + [System.String] + # Last name of the user + ${UserLastName}, + + [Parameter(ParameterSetName = 'UpdateExpanded')] + [Parameter(ParameterSetName = 'UpdateViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Astro.Category('Body')] + [System.String] + # User's phone number + ${UserPhoneNumber}, + + [Parameter(ParameterSetName = 'UpdateExpanded')] + [Parameter(ParameterSetName = 'UpdateViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Astro.Category('Body')] + [System.String] + # User's principal name + ${UserUpn}, + + [Parameter(ParameterSetName = 'UpdateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Astro.Category('Body')] + [System.String] + # Path of Json file supplied to the Update operation + ${JsonFilePath}, + + [Parameter(ParameterSetName = 'UpdateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Astro.Category('Body')] + [System.String] + # Json string supplied to the Update operation + ${JsonString}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Astro.Category('Azure')] + [System.Management.Automation.PSObject] + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Astro.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Astro.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Astro.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Astro.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Astro.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Astro.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Astro.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Astro.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Astro.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Astro.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} + ) + + process { + if ($PSBoundParameters.ContainsKey('EnableSystemAssignedIdentity') -or $PSBoundParameters.ContainsKey('UserAssignedIdentity') ) { + # Get Organization DataObj + $parameterSet = $PSCmdlet.ParameterSetName + if (('UpdateExpanded') -contains $parameterSet) { + $organization = Az.Astro\Get-AzAstroOrganization -Name $Name -ResourceGroupName $ResourceGroupName + } + elseif (('UpdateViaIdentityExpanded') -contains $parameterSet) { + $organization = Az.Astro\Get-AzAstroOrganization -InputObject $InputObject + } + if ($null -eq $organization) { + throw "$Name doesn't exist" + } + + # If user input UserAssignedIdentity + if ($PSBoundParameters.ContainsKey('UserAssignedIdentity')) { + $userIdentityObject = [Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.UserAssignedIdentity]::New() + $PSBoundParameters.IdentityUserAssignedIdentity = @{} + foreach ($item in $PSBoundParameters.UserAssignedIdentity) { + $PSBoundParameters.IdentityUserAssignedIdentity.Add($item, $userIdentityObject ) + } + + if ($organization.IdentityUserAssignedIdentity.Count -gt 0) { + $organization.IdentityUserAssignedIdentity.Keys | ForEach-Object { + if (-NOT($_ -in $UserAssignedIdentity)) { + $PSBoundParameters.IdentityUserAssignedIdentity.Add($_, $null) + } + } + } + } + + # calculate IdentityType + $supportsSystemAssignedIdentity = $EnableSystemAssignedIdentity -or (($null -eq $EnableSystemAssignedIdentity) -and ($organization.IdentityType.Contains('SystemAssigned'))) + $supportsUserAssignedIdentity = ($PSBoundParameters.ContainsKey('UserAssignedIdentity') -and $UserAssignedIdentity.Length -gt 0) -or ((-not $PSBoundParameters.ContainsKey('UserAssignedIdentity')) -and ($organization.IdentityType.Contains('UserAssigned'))); + if (($supportsSystemAssignedIdentity -and $supportsUserAssignedIdentity)) { + $PSBoundParameters.Add("IdentityType", "SystemAssigned,UserAssigned") + } + elseif ($supportsUserAssignedIdentity -and (-not $supportsSystemAssignedIdentity)) { + $PSBoundParameters.Add("IdentityType", "UserAssigned") + } + elseif ((-not $supportsUserAssignedIdentity) -and $supportsSystemAssignedIdentity) { + $PSBoundParameters.Add("IdentityType", "SystemAssigned") + } + else { + $PSBoundParameters.Add("IdentityType", "None") + } + + # remove EnableSystemAssignedIdentity + if ($PSBoundParameters.ContainsKey('EnableSystemAssignedIdentity')) { + $null = $PSBoundParameters.Remove("EnableSystemAssignedIdentity") + } + # remove UserAssignedIdentity + if ($PSBoundParameters.ContainsKey('UserAssignedIdentity')) { + $null = $PSBoundParameters.Remove('UserAssignedIdentity') + } } + Az.Astro.internal\Update-AzAstroOrganization @PSBoundParameters } - Az.Astro.internal\Update-AzAstroOrganization @PSBoundParameters - -} } diff --git a/src/Astro/Astro.Autorest/custom/UserAssignedIdentities.json.cs b/src/Astro/Astro.Autorest/custom/UserAssignedIdentities.json.cs new file mode 100644 index 000000000000..24ae0d78e68c --- /dev/null +++ b/src/Astro/Astro.Autorest/custom/UserAssignedIdentities.json.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Astro.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.Astro.Runtime.Json; + using static Microsoft.Azure.PowerShell.Cmdlets.Astro.Runtime.Extensions; + + /// + /// Gets or sets a list of key value pairs that describe the set of User Assigned identities that will be used with this volume + /// group. The key is the ARM resource identifier of the identity. + /// + public partial class UserAssignedIdentities + { + partial void AfterToJson(ref JsonObject container) + { + if (this.__additionalProperties != null) + { + foreach (var key in this.__additionalProperties) + { + if (key.Value == null) + { + container.Add(key.Key, Runtime.Json.XNull.Instance); + } + } + } + } + } +} \ No newline at end of file diff --git a/src/Astro/Astro.Autorest/generate-portal-ux.ps1 b/src/Astro/Astro.Autorest/generate-portal-ux.ps1 index 57d6290d5eb8..a7f1615ed2e1 100644 --- a/src/Astro/Astro.Autorest/generate-portal-ux.ps1 +++ b/src/Astro/Astro.Autorest/generate-portal-ux.ps1 @@ -247,7 +247,16 @@ function New-MetadataForParameterSet() $cmdletName = Get-MappedCmdletFromFunctionName $ParameterSetInfo.Name $description = (Get-CmdletAttribute -CmdletInfo $ParameterSetInfo -AttributeName "DescriptionAttribute").Description [object[]]$example = New-ExampleForParameterSet $ParameterSetInfo + if ($Null -eq $example) + { + $example = @() + } + [string[]]$signature = New-ParameterArrayInParameterSet $ParameterSetInfo + if ($Null -eq $signature) + { + $signature = @() + } return @{ Path = $httpPath diff --git a/src/Astro/Astro.Autorest/generated/api/Astro.cs b/src/Astro/Astro.Autorest/generated/api/Astro.cs index 57256a900c25..db6f47c1da19 100644 --- a/src/Astro/Astro.Autorest/generated/api/Astro.cs +++ b/src/Astro/Astro.Autorest/generated/api/Astro.cs @@ -295,7 +295,7 @@ public partial class Astro } } - /// Update a OrganizationResource + /// update a OrganizationResource /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Name of the Organizations resource @@ -344,7 +344,7 @@ public partial class Astro } } - /// Update a OrganizationResource + /// update a OrganizationResource /// /// Resource create parameters. /// a delegate that is called when the remote service returns 200 (OK). @@ -403,7 +403,7 @@ public partial class Astro } } - /// Update a OrganizationResource + /// update a OrganizationResource /// /// Resource create parameters. /// an instance that will receive events. @@ -460,7 +460,7 @@ public partial class Astro } } - /// Update a OrganizationResource + /// update a OrganizationResource /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Name of the Organizations resource @@ -508,7 +508,7 @@ public partial class Astro } } - /// Update a OrganizationResource + /// update a OrganizationResource /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Name of the Organizations resource @@ -554,7 +554,7 @@ public partial class Astro } } - /// Update a OrganizationResource + /// update a OrganizationResource /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Name of the Organizations resource @@ -2139,7 +2139,7 @@ public partial class Astro } } - /// Update a OrganizationResource + /// update a OrganizationResource /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Name of the Organizations resource @@ -2188,7 +2188,7 @@ public partial class Astro } } - /// Update a OrganizationResource + /// update a OrganizationResource /// /// The resource properties to be updated. /// a delegate that is called when the remote service returns 200 (OK). @@ -2247,7 +2247,7 @@ public partial class Astro } } - /// Update a OrganizationResource + /// update a OrganizationResource /// /// The resource properties to be updated. /// an instance that will receive events. @@ -2304,7 +2304,7 @@ public partial class Astro } } - /// Update a OrganizationResource + /// update a OrganizationResource /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Name of the Organizations resource @@ -2352,7 +2352,7 @@ public partial class Astro } } - /// Update a OrganizationResource + /// update a OrganizationResource /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Name of the Organizations resource @@ -2398,7 +2398,7 @@ public partial class Astro } } - /// Update a OrganizationResource + /// update a OrganizationResource /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Name of the Organizations resource diff --git a/src/Astro/Astro.Autorest/generated/api/Models/UserAssignedIdentities.dictionary.cs b/src/Astro/Astro.Autorest/generated/api/Models/UserAssignedIdentities.dictionary.cs index 3bb9f27d1df7..631912d10710 100644 --- a/src/Astro/Astro.Autorest/generated/api/Models/UserAssignedIdentities.dictionary.cs +++ b/src/Astro/Astro.Autorest/generated/api/Models/UserAssignedIdentities.dictionary.cs @@ -38,7 +38,7 @@ public void CopyFrom(global::System.Collections.IDictionary source) { foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.Astro.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) { - if ((null != property.Key && null != property.Value)) + if ((null != property.Key)) { this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); } diff --git a/src/Astro/Astro.Autorest/generated/cmdlets/NewAzAstroOrganization_CreateExpanded.cs b/src/Astro/Astro.Autorest/generated/cmdlets/NewAzAstroOrganization_CreateExpanded.cs index 943422efae8d..bb118fd85aa3 100644 --- a/src/Astro/Astro.Autorest/generated/cmdlets/NewAzAstroOrganization_CreateExpanded.cs +++ b/src/Astro/Astro.Autorest/generated/cmdlets/NewAzAstroOrganization_CreateExpanded.cs @@ -10,14 +10,14 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Astro.Cmdlets using Microsoft.Azure.PowerShell.Cmdlets.Astro.Runtime.Cmdlets; using System; - /// Create a OrganizationResource + /// create a OrganizationResource /// /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Astronomer.Astro/organizations/{organizationName}" /// [global::Microsoft.Azure.PowerShell.Cmdlets.Astro.InternalExport] [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzAstroOrganization_CreateExpanded", SupportsShouldProcess = true)] [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IOrganizationResource))] - [global::Microsoft.Azure.PowerShell.Cmdlets.Astro.Description(@"Create a OrganizationResource")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Astro.Description(@"create a OrganizationResource")] [global::Microsoft.Azure.PowerShell.Cmdlets.Astro.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Astro.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Astronomer.Astro/organizations/{organizationName}", ApiVersion = "2023-08-01")] public partial class NewAzAstroOrganization_CreateExpanded : global::System.Management.Automation.PSCmdlet, @@ -108,6 +108,22 @@ public partial class NewAzAstroOrganization_CreateExpanded : global::System.Mana [global::Microsoft.Azure.PowerShell.Cmdlets.Astro.PSArgumentCompleterAttribute("None", "SystemAssigned", "UserAssigned", "SystemAssigned, UserAssigned")] public string IdentityType { get => _resourceBody.IdentityType ?? null; set => _resourceBody.IdentityType = value; } + /// + /// The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys will be ARM + /// resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. + /// The dictionary values can be empty objects ({}) in requests. + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.Astro.ExportAs(typeof(global::System.Collections.Hashtable))] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. The dictionary values can be empty objects ({}) in requests.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Astro.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Astro.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Astro.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. The dictionary values can be empty objects ({}) in requests.", + SerializedName = @"userAssignedIdentities", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IUserAssignedIdentities) })] + public Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IUserAssignedIdentities IdentityUserAssignedIdentity { get => _resourceBody.IdentityUserAssignedIdentity ?? null /* object */; set => _resourceBody.IdentityUserAssignedIdentity = value; } + /// Accessor for our copy of the InvocationInfo. public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } @@ -398,14 +414,6 @@ public partial class NewAzAstroOrganization_CreateExpanded : global::System.Mana PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.ITrackedResourceTags) })] public Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.ITrackedResourceTags Tag { get => _resourceBody.Tag ?? null /* object */; set => _resourceBody.Tag = value; } - /// - /// The array of user assigned identities associated with the resource. The elements in array will be ARM resource ids in - /// the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}.' - /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The array of user assigned identities associated with the resource. The elements in array will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}.'")] - [global::System.Management.Automation.AllowEmptyCollection] - public string[] UserAssignedIdentity { get; set; } - /// Email address of the user [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Email address of the user")] [global::Microsoft.Azure.PowerShell.Cmdlets.Astro.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Astro.ParameterCategory.Body)] @@ -748,15 +756,6 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.Astro.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Astro.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Astro.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - if (this.UserAssignedIdentity?.Length > 0) - { - // calculate UserAssignedIdentity - _resourceBody.IdentityUserAssignedIdentity.Clear(); - foreach( var id in this.UserAssignedIdentity ) - { - _resourceBody.IdentityUserAssignedIdentity.Add(id, new Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.UserAssignedIdentity()); - } - } await this.Client.OrganizationsCreateOrUpdate(SubscriptionId, ResourceGroupName, Name, _resourceBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.Astro.Runtime.SerializationMode.IncludeCreate); await ((Microsoft.Azure.PowerShell.Cmdlets.Astro.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Astro.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Astro.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } diff --git a/src/Astro/Astro.Autorest/generated/cmdlets/NewAzAstroOrganization_CreateViaJsonFilePath.cs b/src/Astro/Astro.Autorest/generated/cmdlets/NewAzAstroOrganization_CreateViaJsonFilePath.cs index 77eab441445e..6fe78aa15fed 100644 --- a/src/Astro/Astro.Autorest/generated/cmdlets/NewAzAstroOrganization_CreateViaJsonFilePath.cs +++ b/src/Astro/Astro.Autorest/generated/cmdlets/NewAzAstroOrganization_CreateViaJsonFilePath.cs @@ -10,14 +10,14 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Astro.Cmdlets using Microsoft.Azure.PowerShell.Cmdlets.Astro.Runtime.Cmdlets; using System; - /// Create a OrganizationResource + /// create a OrganizationResource /// /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Astronomer.Astro/organizations/{organizationName}" /// [global::Microsoft.Azure.PowerShell.Cmdlets.Astro.InternalExport] [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzAstroOrganization_CreateViaJsonFilePath", SupportsShouldProcess = true)] [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IOrganizationResource))] - [global::Microsoft.Azure.PowerShell.Cmdlets.Astro.Description(@"Create a OrganizationResource")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Astro.Description(@"create a OrganizationResource")] [global::Microsoft.Azure.PowerShell.Cmdlets.Astro.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Astro.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Astronomer.Astro/organizations/{organizationName}", ApiVersion = "2023-08-01")] [global::Microsoft.Azure.PowerShell.Cmdlets.Astro.NotSuggestDefaultParameterSet] diff --git a/src/Astro/Astro.Autorest/generated/cmdlets/NewAzAstroOrganization_CreateViaJsonString.cs b/src/Astro/Astro.Autorest/generated/cmdlets/NewAzAstroOrganization_CreateViaJsonString.cs index ca26deb4dbd4..fb50df76ee75 100644 --- a/src/Astro/Astro.Autorest/generated/cmdlets/NewAzAstroOrganization_CreateViaJsonString.cs +++ b/src/Astro/Astro.Autorest/generated/cmdlets/NewAzAstroOrganization_CreateViaJsonString.cs @@ -10,14 +10,14 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Astro.Cmdlets using Microsoft.Azure.PowerShell.Cmdlets.Astro.Runtime.Cmdlets; using System; - /// Create a OrganizationResource + /// create a OrganizationResource /// /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Astronomer.Astro/organizations/{organizationName}" /// [global::Microsoft.Azure.PowerShell.Cmdlets.Astro.InternalExport] [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzAstroOrganization_CreateViaJsonString", SupportsShouldProcess = true)] [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IOrganizationResource))] - [global::Microsoft.Azure.PowerShell.Cmdlets.Astro.Description(@"Create a OrganizationResource")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Astro.Description(@"create a OrganizationResource")] [global::Microsoft.Azure.PowerShell.Cmdlets.Astro.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Astro.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Astronomer.Astro/organizations/{organizationName}", ApiVersion = "2023-08-01")] [global::Microsoft.Azure.PowerShell.Cmdlets.Astro.NotSuggestDefaultParameterSet] diff --git a/src/Astro/Astro.Autorest/generated/cmdlets/UpdateAzAstroOrganization_UpdateExpanded.cs b/src/Astro/Astro.Autorest/generated/cmdlets/UpdateAzAstroOrganization_UpdateExpanded.cs index b92d01ece271..223fc651a493 100644 --- a/src/Astro/Astro.Autorest/generated/cmdlets/UpdateAzAstroOrganization_UpdateExpanded.cs +++ b/src/Astro/Astro.Autorest/generated/cmdlets/UpdateAzAstroOrganization_UpdateExpanded.cs @@ -10,14 +10,14 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Astro.Cmdlets using Microsoft.Azure.PowerShell.Cmdlets.Astro.Runtime.Cmdlets; using System; - /// Update a OrganizationResource + /// update a OrganizationResource /// /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Astronomer.Astro/organizations/{organizationName}" /// [global::Microsoft.Azure.PowerShell.Cmdlets.Astro.InternalExport] [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzAstroOrganization_UpdateExpanded", SupportsShouldProcess = true)] [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IOrganizationResource))] - [global::Microsoft.Azure.PowerShell.Cmdlets.Astro.Description(@"Update a OrganizationResource")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Astro.Description(@"update a OrganizationResource")] [global::Microsoft.Azure.PowerShell.Cmdlets.Astro.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Astro.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Astronomer.Astro/organizations/{organizationName}", ApiVersion = "2023-08-01")] public partial class UpdateAzAstroOrganization_UpdateExpanded : global::System.Management.Automation.PSCmdlet, @@ -108,6 +108,22 @@ public partial class UpdateAzAstroOrganization_UpdateExpanded : global::System.M [global::Microsoft.Azure.PowerShell.Cmdlets.Astro.PSArgumentCompleterAttribute("None", "SystemAssigned", "UserAssigned", "SystemAssigned, UserAssigned")] public string IdentityType { get => _propertiesBody.IdentityType ?? null; set => _propertiesBody.IdentityType = value; } + /// + /// The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys will be ARM + /// resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. + /// The dictionary values can be empty objects ({}) in requests. + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.Astro.ExportAs(typeof(global::System.Collections.Hashtable))] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. The dictionary values can be empty objects ({}) in requests.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Astro.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Astro.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Astro.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. The dictionary values can be empty objects ({}) in requests.", + SerializedName = @"userAssignedIdentities", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IUserAssignedIdentities) })] + public Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IUserAssignedIdentities IdentityUserAssignedIdentity { get => _propertiesBody.IdentityUserAssignedIdentity ?? null /* object */; set => _propertiesBody.IdentityUserAssignedIdentity = value; } + /// Accessor for our copy of the InvocationInfo. public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } @@ -298,14 +314,6 @@ public partial class UpdateAzAstroOrganization_UpdateExpanded : global::System.M PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IOrganizationResourceUpdateTags) })] public Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IOrganizationResourceUpdateTags Tag { get => _propertiesBody.Tag ?? null /* object */; set => _propertiesBody.Tag = value; } - /// - /// The array of user assigned identities associated with the resource. The elements in array will be ARM resource ids in - /// the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}.' - /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The array of user assigned identities associated with the resource. The elements in array will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}.'")] - [global::System.Management.Automation.AllowEmptyCollection] - public string[] UserAssignedIdentity { get; set; } - /// Email address of the user [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Email address of the user")] [global::Microsoft.Azure.PowerShell.Cmdlets.Astro.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Astro.ParameterCategory.Body)] @@ -640,15 +648,6 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.Astro.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Astro.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Astro.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - if (this.UserAssignedIdentity?.Length > 0) - { - // calculate UserAssignedIdentity - _propertiesBody.IdentityUserAssignedIdentity.Clear(); - foreach( var id in this.UserAssignedIdentity ) - { - _propertiesBody.IdentityUserAssignedIdentity.Add(id, new Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.UserAssignedIdentity()); - } - } await this.Client.OrganizationsUpdate(SubscriptionId, ResourceGroupName, Name, _propertiesBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.Astro.Runtime.SerializationMode.IncludeUpdate); await ((Microsoft.Azure.PowerShell.Cmdlets.Astro.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Astro.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Astro.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } diff --git a/src/Astro/Astro.Autorest/generated/cmdlets/UpdateAzAstroOrganization_UpdateViaIdentityExpanded.cs b/src/Astro/Astro.Autorest/generated/cmdlets/UpdateAzAstroOrganization_UpdateViaIdentityExpanded.cs index d025a380c059..3e3b50785c27 100644 --- a/src/Astro/Astro.Autorest/generated/cmdlets/UpdateAzAstroOrganization_UpdateViaIdentityExpanded.cs +++ b/src/Astro/Astro.Autorest/generated/cmdlets/UpdateAzAstroOrganization_UpdateViaIdentityExpanded.cs @@ -10,14 +10,14 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Astro.Cmdlets using Microsoft.Azure.PowerShell.Cmdlets.Astro.Runtime.Cmdlets; using System; - /// Update a OrganizationResource + /// update a OrganizationResource /// /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Astronomer.Astro/organizations/{organizationName}" /// [global::Microsoft.Azure.PowerShell.Cmdlets.Astro.InternalExport] [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzAstroOrganization_UpdateViaIdentityExpanded", SupportsShouldProcess = true)] [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IOrganizationResource))] - [global::Microsoft.Azure.PowerShell.Cmdlets.Astro.Description(@"Update a OrganizationResource")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Astro.Description(@"update a OrganizationResource")] [global::Microsoft.Azure.PowerShell.Cmdlets.Astro.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Astro.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Astronomer.Astro/organizations/{organizationName}", ApiVersion = "2023-08-01")] public partial class UpdateAzAstroOrganization_UpdateViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, @@ -108,6 +108,22 @@ public partial class UpdateAzAstroOrganization_UpdateViaIdentityExpanded : globa [global::Microsoft.Azure.PowerShell.Cmdlets.Astro.PSArgumentCompleterAttribute("None", "SystemAssigned", "UserAssigned", "SystemAssigned, UserAssigned")] public string IdentityType { get => _propertiesBody.IdentityType ?? null; set => _propertiesBody.IdentityType = value; } + /// + /// The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys will be ARM + /// resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. + /// The dictionary values can be empty objects ({}) in requests. + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.Astro.ExportAs(typeof(global::System.Collections.Hashtable))] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. The dictionary values can be empty objects ({}) in requests.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Astro.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Astro.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Astro.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. The dictionary values can be empty objects ({}) in requests.", + SerializedName = @"userAssignedIdentities", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IUserAssignedIdentities) })] + public Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IUserAssignedIdentities IdentityUserAssignedIdentity { get => _propertiesBody.IdentityUserAssignedIdentity ?? null /* object */; set => _propertiesBody.IdentityUserAssignedIdentity = value; } + /// Backing field for property. private Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IAstroIdentity _inputObject; @@ -258,14 +274,6 @@ public partial class UpdateAzAstroOrganization_UpdateViaIdentityExpanded : globa PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IOrganizationResourceUpdateTags) })] public Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IOrganizationResourceUpdateTags Tag { get => _propertiesBody.Tag ?? null /* object */; set => _propertiesBody.Tag = value; } - /// - /// The array of user assigned identities associated with the resource. The elements in array will be ARM resource ids in - /// the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}.' - /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The array of user assigned identities associated with the resource. The elements in array will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}.'")] - [global::System.Management.Automation.AllowEmptyCollection] - public string[] UserAssignedIdentity { get; set; } - /// Email address of the user [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Email address of the user")] [global::Microsoft.Azure.PowerShell.Cmdlets.Astro.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Astro.ParameterCategory.Body)] @@ -599,15 +607,6 @@ protected override void ProcessRecord() await ((Microsoft.Azure.PowerShell.Cmdlets.Astro.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Astro.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Astro.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } if (InputObject?.Id != null) { - if (this.UserAssignedIdentity?.Length > 0) - { - // calculate UserAssignedIdentity - _propertiesBody.IdentityUserAssignedIdentity.Clear(); - foreach( var id in this.UserAssignedIdentity ) - { - _propertiesBody.IdentityUserAssignedIdentity.Add(id, new Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.UserAssignedIdentity()); - } - } await this.Client.OrganizationsUpdateViaIdentity(InputObject.Id, _propertiesBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.Astro.Runtime.SerializationMode.IncludeUpdate); } else @@ -625,15 +624,6 @@ protected override void ProcessRecord() { ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.OrganizationName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); } - if (this.UserAssignedIdentity?.Length > 0) - { - // calculate UserAssignedIdentity - _propertiesBody.IdentityUserAssignedIdentity.Clear(); - foreach( var id in this.UserAssignedIdentity ) - { - _propertiesBody.IdentityUserAssignedIdentity.Add(id, new Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.UserAssignedIdentity()); - } - } await this.Client.OrganizationsUpdate(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.OrganizationName ?? null, _propertiesBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.Astro.Runtime.SerializationMode.IncludeUpdate); } await ((Microsoft.Azure.PowerShell.Cmdlets.Astro.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Astro.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Astro.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } diff --git a/src/Astro/Astro.Autorest/generated/cmdlets/UpdateAzAstroOrganization_UpdateViaJsonFilePath.cs b/src/Astro/Astro.Autorest/generated/cmdlets/UpdateAzAstroOrganization_UpdateViaJsonFilePath.cs index 70e6d7bed8cf..ab4f2bc82600 100644 --- a/src/Astro/Astro.Autorest/generated/cmdlets/UpdateAzAstroOrganization_UpdateViaJsonFilePath.cs +++ b/src/Astro/Astro.Autorest/generated/cmdlets/UpdateAzAstroOrganization_UpdateViaJsonFilePath.cs @@ -10,14 +10,14 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Astro.Cmdlets using Microsoft.Azure.PowerShell.Cmdlets.Astro.Runtime.Cmdlets; using System; - /// Update a OrganizationResource + /// update a OrganizationResource /// /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Astronomer.Astro/organizations/{organizationName}" /// [global::Microsoft.Azure.PowerShell.Cmdlets.Astro.InternalExport] [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzAstroOrganization_UpdateViaJsonFilePath", SupportsShouldProcess = true)] [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IOrganizationResource))] - [global::Microsoft.Azure.PowerShell.Cmdlets.Astro.Description(@"Update a OrganizationResource")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Astro.Description(@"update a OrganizationResource")] [global::Microsoft.Azure.PowerShell.Cmdlets.Astro.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Astro.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Astronomer.Astro/organizations/{organizationName}", ApiVersion = "2023-08-01")] [global::Microsoft.Azure.PowerShell.Cmdlets.Astro.NotSuggestDefaultParameterSet] diff --git a/src/Astro/Astro.Autorest/generated/cmdlets/UpdateAzAstroOrganization_UpdateViaJsonString.cs b/src/Astro/Astro.Autorest/generated/cmdlets/UpdateAzAstroOrganization_UpdateViaJsonString.cs index e6472e4513b4..8438e96e2121 100644 --- a/src/Astro/Astro.Autorest/generated/cmdlets/UpdateAzAstroOrganization_UpdateViaJsonString.cs +++ b/src/Astro/Astro.Autorest/generated/cmdlets/UpdateAzAstroOrganization_UpdateViaJsonString.cs @@ -10,14 +10,14 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Astro.Cmdlets using Microsoft.Azure.PowerShell.Cmdlets.Astro.Runtime.Cmdlets; using System; - /// Update a OrganizationResource + /// update a OrganizationResource /// /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Astronomer.Astro/organizations/{organizationName}" /// [global::Microsoft.Azure.PowerShell.Cmdlets.Astro.InternalExport] [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzAstroOrganization_UpdateViaJsonString", SupportsShouldProcess = true)] [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IOrganizationResource))] - [global::Microsoft.Azure.PowerShell.Cmdlets.Astro.Description(@"Update a OrganizationResource")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Astro.Description(@"update a OrganizationResource")] [global::Microsoft.Azure.PowerShell.Cmdlets.Astro.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Astro.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Astronomer.Astro/organizations/{organizationName}", ApiVersion = "2023-08-01")] [global::Microsoft.Azure.PowerShell.Cmdlets.Astro.NotSuggestDefaultParameterSet] diff --git a/src/Astro/Astro.Autorest/internal/New-AzAstroOrganization.ps1 b/src/Astro/Astro.Autorest/internal/New-AzAstroOrganization.ps1 index e41d5a696023..ed0ce10a2cc0 100644 --- a/src/Astro/Astro.Autorest/internal/New-AzAstroOrganization.ps1 +++ b/src/Astro/Astro.Autorest/internal/New-AzAstroOrganization.ps1 @@ -16,9 +16,9 @@ <# .Synopsis -Create a OrganizationResource +create a OrganizationResource .Description -Create a OrganizationResource +create a OrganizationResource .Example New-AzAstroOrganization -Name UT.7.test -ResourceGroupName astro-user -Location eastus -MarketplaceSubscriptionId 11111111-2222-3333-4444-123456789101 -OfferDetailOfferId astro -OfferDetailPlanId astro-paygo -OfferDetailPublisherId astronomer1 -OfferDetailPlanName 'Monthly Pay-As-You-Go' -OfferDetailTermId abcdefghijkl -OfferDetailTermUnit Monthly -UserEmailAddress example@microsoft.com -UserFirstName user -UserLastName test -UserUpn example@microsoft.com -PartnerOrganizationPropertyWorkspaceName aaa -PartnerOrganizationPropertyOrganizationName bbb -SingleSignOnPropertyAadDomain MicrosoftCustomerLed.onmicrosoft.com @@ -107,6 +107,15 @@ param( # Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). ${IdentityType}, + [Parameter(ParameterSetName='CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Astro.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Astro.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IUserAssignedIdentities]))] + [System.Collections.Hashtable] + # The set of user assigned identities associated with the resource. + # The userAssignedIdentities dictionary keys will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. + # The dictionary values can be empty objects ({}) in requests. + ${IdentityUserAssignedIdentity}, + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Astro.PSArgumentCompleterAttribute("PendingFulfillmentStart", "Subscribed", "Suspended", "Unsubscribed")] [Microsoft.Azure.PowerShell.Cmdlets.Astro.Category('Body')] @@ -189,14 +198,6 @@ param( # Resource tags. ${Tag}, - [Parameter(ParameterSetName='CreateExpanded')] - [AllowEmptyCollection()] - [Microsoft.Azure.PowerShell.Cmdlets.Astro.Category('Body')] - [System.String[]] - # The array of user assigned identities associated with the resource. - # The elements in array will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}.' - ${UserAssignedIdentity}, - [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Astro.Category('Body')] [System.String] diff --git a/src/Astro/Astro.Autorest/internal/ProxyCmdletDefinitions.ps1 b/src/Astro/Astro.Autorest/internal/ProxyCmdletDefinitions.ps1 index 55f1c3fc6324..a70ae866efbf 100644 --- a/src/Astro/Astro.Autorest/internal/ProxyCmdletDefinitions.ps1 +++ b/src/Astro/Astro.Autorest/internal/ProxyCmdletDefinitions.ps1 @@ -126,9 +126,9 @@ end { <# .Synopsis -Create a OrganizationResource +create a OrganizationResource .Description -Create a OrganizationResource +create a OrganizationResource .Example New-AzAstroOrganization -Name UT.7.test -ResourceGroupName astro-user -Location eastus -MarketplaceSubscriptionId 11111111-2222-3333-4444-123456789101 -OfferDetailOfferId astro -OfferDetailPlanId astro-paygo -OfferDetailPublisherId astronomer1 -OfferDetailPlanName 'Monthly Pay-As-You-Go' -OfferDetailTermId abcdefghijkl -OfferDetailTermUnit Monthly -UserEmailAddress example@microsoft.com -UserFirstName user -UserLastName test -UserUpn example@microsoft.com -PartnerOrganizationPropertyWorkspaceName aaa -PartnerOrganizationPropertyOrganizationName bbb -SingleSignOnPropertyAadDomain MicrosoftCustomerLed.onmicrosoft.com @@ -217,6 +217,15 @@ param( # Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). ${IdentityType}, + [Parameter(ParameterSetName='CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Astro.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Astro.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IUserAssignedIdentities]))] + [System.Collections.Hashtable] + # The set of user assigned identities associated with the resource. + # The userAssignedIdentities dictionary keys will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. + # The dictionary values can be empty objects ({}) in requests. + ${IdentityUserAssignedIdentity}, + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Astro.PSArgumentCompleterAttribute("PendingFulfillmentStart", "Subscribed", "Suspended", "Unsubscribed")] [Microsoft.Azure.PowerShell.Cmdlets.Astro.Category('Body')] @@ -299,14 +308,6 @@ param( # Resource tags. ${Tag}, - [Parameter(ParameterSetName='CreateExpanded')] - [AllowEmptyCollection()] - [Microsoft.Azure.PowerShell.Cmdlets.Astro.Category('Body')] - [System.String[]] - # The array of user assigned identities associated with the resource. - # The elements in array will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}.' - ${UserAssignedIdentity}, - [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Astro.Category('Body')] [System.String] @@ -447,9 +448,9 @@ end { <# .Synopsis -Update a OrganizationResource +update a OrganizationResource .Description -Update a OrganizationResource +update a OrganizationResource .Example Update-AzAstroOrganization -Name UT.7.test -ResourceGroupName astro-user -UserUpn example@microsoft.com -PartnerOrganizationPropertyOrganizationId cccccccc -PartnerOrganizationPropertyWorkspaceId dddddddd -PartnerOrganizationPropertyWorkspaceName eeeeeee -PartnerOrganizationPropertyOrganizationName kkkkkkkkkkkk -SingleSignOnPropertyEnterpriseAppId llllllll -SingleSignOnPropertyAadDomain MicrosoftCustomerLed.onmicrosoft.com @@ -515,6 +516,16 @@ param( # Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). ${IdentityType}, + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Astro.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Astro.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IUserAssignedIdentities]))] + [System.Collections.Hashtable] + # The set of user assigned identities associated with the resource. + # The userAssignedIdentities dictionary keys will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. + # The dictionary values can be empty objects ({}) in requests. + ${IdentityUserAssignedIdentity}, + [Parameter(ParameterSetName='UpdateExpanded')] [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Astro.Category('Body')] @@ -581,15 +592,6 @@ param( # Resource tags. ${Tag}, - [Parameter(ParameterSetName='UpdateExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] - [AllowEmptyCollection()] - [Microsoft.Azure.PowerShell.Cmdlets.Astro.Category('Body')] - [System.String[]] - # The array of user assigned identities associated with the resource. - # The elements in array will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}.' - ${UserAssignedIdentity}, - [Parameter(ParameterSetName='UpdateExpanded')] [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Astro.Category('Body')] diff --git a/src/Astro/Astro.Autorest/internal/Update-AzAstroOrganization.ps1 b/src/Astro/Astro.Autorest/internal/Update-AzAstroOrganization.ps1 index fc67a33e95fa..c373f0583d26 100644 --- a/src/Astro/Astro.Autorest/internal/Update-AzAstroOrganization.ps1 +++ b/src/Astro/Astro.Autorest/internal/Update-AzAstroOrganization.ps1 @@ -16,9 +16,9 @@ <# .Synopsis -Update a OrganizationResource +update a OrganizationResource .Description -Update a OrganizationResource +update a OrganizationResource .Example Update-AzAstroOrganization -Name UT.7.test -ResourceGroupName astro-user -UserUpn example@microsoft.com -PartnerOrganizationPropertyOrganizationId cccccccc -PartnerOrganizationPropertyWorkspaceId dddddddd -PartnerOrganizationPropertyWorkspaceName eeeeeee -PartnerOrganizationPropertyOrganizationName kkkkkkkkkkkk -SingleSignOnPropertyEnterpriseAppId llllllll -SingleSignOnPropertyAadDomain MicrosoftCustomerLed.onmicrosoft.com @@ -84,6 +84,16 @@ param( # Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). ${IdentityType}, + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Astro.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Astro.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IUserAssignedIdentities]))] + [System.Collections.Hashtable] + # The set of user assigned identities associated with the resource. + # The userAssignedIdentities dictionary keys will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. + # The dictionary values can be empty objects ({}) in requests. + ${IdentityUserAssignedIdentity}, + [Parameter(ParameterSetName='UpdateExpanded')] [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Astro.Category('Body')] @@ -150,15 +160,6 @@ param( # Resource tags. ${Tag}, - [Parameter(ParameterSetName='UpdateExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] - [AllowEmptyCollection()] - [Microsoft.Azure.PowerShell.Cmdlets.Astro.Category('Body')] - [System.String[]] - # The array of user assigned identities associated with the resource. - # The elements in array will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}.' - ${UserAssignedIdentity}, - [Parameter(ParameterSetName='UpdateExpanded')] [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Astro.Category('Body')] diff --git a/src/Astro/Astro/Az.Astro.psd1 b/src/Astro/Astro/Az.Astro.psd1 index e130e175c273..68e00c558fa8 100644 --- a/src/Astro/Astro/Az.Astro.psd1 +++ b/src/Astro/Astro/Az.Astro.psd1 @@ -3,7 +3,7 @@ # # Generated by: Microsoft Corporation # -# Generated on: 8/26/2024 +# Generated on: 11/8/2024 # @{ @@ -51,7 +51,7 @@ DotNetFrameworkVersion = '4.7.2' # ProcessorArchitecture = '' # Modules that must be imported into the global environment prior to importing this module -RequiredModules = @(@{ModuleName = 'Az.Accounts'; ModuleVersion = '3.0.3'; }) +RequiredModules = @(@{ModuleName = 'Az.Accounts'; ModuleVersion = '3.0.4'; }) # Assemblies that must be loaded prior to importing this module RequiredAssemblies = 'Astro.Autorest/bin/Az.Astro.private.dll' diff --git a/src/Astro/Astro/ChangeLog.md b/src/Astro/Astro/ChangeLog.md index 4c2a2d560972..28f81bf5623a 100644 --- a/src/Astro/Astro/ChangeLog.md +++ b/src/Astro/Astro/ChangeLog.md @@ -18,6 +18,7 @@ - Additional information about change #1 --> ## Upcoming Release +* Fixed Issue that failed when deleting or replacing UserAssignedIdentity. ## Version 0.1.0 * First preview release for module Az.Astro diff --git a/src/Astro/Astro/help/Get-AzAstroOrganization.md b/src/Astro/Astro/help/Get-AzAstroOrganization.md index 39899dfeba3a..47a270d2f3e1 100644 --- a/src/Astro/Astro/help/Get-AzAstroOrganization.md +++ b/src/Astro/Astro/help/Get-AzAstroOrganization.md @@ -15,25 +15,25 @@ Get a OrganizationResource ### List (Default) ``` Get-AzAstroOrganization [-SubscriptionId ] [-DefaultProfile ] - [] + [-ProgressAction ] [] ``` ### Get ``` Get-AzAstroOrganization -Name -ResourceGroupName [-SubscriptionId ] - [-DefaultProfile ] [] + [-DefaultProfile ] [-ProgressAction ] [] ``` ### List1 ``` Get-AzAstroOrganization -ResourceGroupName [-SubscriptionId ] [-DefaultProfile ] - [] + [-ProgressAction ] [] ``` ### GetViaIdentity ``` Get-AzAstroOrganization -InputObject [-DefaultProfile ] - [] + [-ProgressAction ] [] ``` ## DESCRIPTION @@ -184,6 +184,21 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -ProgressAction +{{ Fill ProgressAction Description }} + +```yaml +Type: System.Management.Automation.ActionPreference +Parameter Sets: (All) +Aliases: proga + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -ResourceGroupName The name of the resource group. The name is case insensitive. diff --git a/src/Astro/Astro/help/New-AzAstroOrganization.md b/src/Astro/Astro/help/New-AzAstroOrganization.md index ec56d5fb4124..d7bda1ade719 100644 --- a/src/Astro/Astro/help/New-AzAstroOrganization.md +++ b/src/Astro/Astro/help/New-AzAstroOrganization.md @@ -25,20 +25,20 @@ New-AzAstroOrganization -Name -ResourceGroupName [-Subscriptio [-SingleSignOnPropertyEnterpriseAppId ] [-SingleSignOnPropertySingleSignOnState ] [-SingleSignOnPropertySingleSignOnUrl ] [-Tag ] [-UserAssignedIdentity ] [-UserPhoneNumber ] [-UserUpn ] [-DefaultProfile ] [-AsJob] [-NoWait] - [-WhatIf] [-Confirm] [] + [-ProgressAction ] [-WhatIf] [-Confirm] [] ``` ### CreateViaJsonFilePath ``` New-AzAstroOrganization -Name -ResourceGroupName [-SubscriptionId ] - -JsonFilePath [-DefaultProfile ] [-AsJob] [-NoWait] + -JsonFilePath [-DefaultProfile ] [-AsJob] [-NoWait] [-ProgressAction ] [-WhatIf] [-Confirm] [] ``` ### CreateViaJsonString ``` New-AzAstroOrganization -Name -ResourceGroupName [-SubscriptionId ] - -JsonString [-DefaultProfile ] [-AsJob] [-NoWait] + -JsonString [-DefaultProfile ] [-AsJob] [-NoWait] [-ProgressAction ] [-WhatIf] [-Confirm] [] ``` @@ -401,6 +401,21 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -ProgressAction +{{ Fill ProgressAction Description }} + +```yaml +Type: System.Management.Automation.ActionPreference +Parameter Sets: (All) +Aliases: proga + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -ResourceGroupName The name of the resource group. The name is case insensitive. diff --git a/src/Astro/Astro/help/Remove-AzAstroOrganization.md b/src/Astro/Astro/help/Remove-AzAstroOrganization.md index d6173b7c2acd..61c59f4fcdde 100644 --- a/src/Astro/Astro/help/Remove-AzAstroOrganization.md +++ b/src/Astro/Astro/help/Remove-AzAstroOrganization.md @@ -15,14 +15,14 @@ Delete a OrganizationResource ### Delete (Default) ``` Remove-AzAstroOrganization -Name -ResourceGroupName [-SubscriptionId ] - [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] [-WhatIf] + [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] [-ProgressAction ] [-WhatIf] [-Confirm] [] ``` ### DeleteViaIdentity ``` Remove-AzAstroOrganization -InputObject [-DefaultProfile ] [-AsJob] [-NoWait] - [-PassThru] [-WhatIf] [-Confirm] [] + [-PassThru] [-ProgressAction ] [-WhatIf] [-Confirm] [] ``` ## DESCRIPTION @@ -130,6 +130,21 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -ProgressAction +{{ Fill ProgressAction Description }} + +```yaml +Type: System.Management.Automation.ActionPreference +Parameter Sets: (All) +Aliases: proga + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -ResourceGroupName The name of the resource group. The name is case insensitive. diff --git a/src/Astro/Astro/help/Update-AzAstroOrganization.md b/src/Astro/Astro/help/Update-AzAstroOrganization.md index 0f7b0af011ab..c5d0bd0460f1 100644 --- a/src/Astro/Astro/help/Update-AzAstroOrganization.md +++ b/src/Astro/Astro/help/Update-AzAstroOrganization.md @@ -21,21 +21,21 @@ Update-AzAstroOrganization -Name -ResourceGroupName [-Subscrip [-SingleSignOnPropertyEnterpriseAppId ] [-SingleSignOnPropertySingleSignOnState ] [-SingleSignOnPropertySingleSignOnUrl ] [-Tag ] [-UserAssignedIdentity ] [-UserEmailAddress ] [-UserFirstName ] [-UserLastName ] [-UserPhoneNumber ] - [-UserUpn ] [-DefaultProfile ] [-AsJob] [-NoWait] + [-UserUpn ] [-DefaultProfile ] [-AsJob] [-NoWait] [-ProgressAction ] [-WhatIf] [-Confirm] [] ``` ### UpdateViaJsonFilePath ``` Update-AzAstroOrganization -Name -ResourceGroupName [-SubscriptionId ] - -JsonFilePath [-DefaultProfile ] [-AsJob] [-NoWait] + -JsonFilePath [-DefaultProfile ] [-AsJob] [-NoWait] [-ProgressAction ] [-WhatIf] [-Confirm] [] ``` ### UpdateViaJsonString ``` Update-AzAstroOrganization -Name -ResourceGroupName [-SubscriptionId ] - -JsonString [-DefaultProfile ] [-AsJob] [-NoWait] + -JsonString [-DefaultProfile ] [-AsJob] [-NoWait] [-ProgressAction ] [-WhatIf] [-Confirm] [] ``` @@ -48,7 +48,7 @@ Update-AzAstroOrganization -InputObject [-EnableSystemAssignedI [-SingleSignOnPropertySingleSignOnState ] [-SingleSignOnPropertySingleSignOnUrl ] [-Tag ] [-UserAssignedIdentity ] [-UserEmailAddress ] [-UserFirstName ] [-UserLastName ] [-UserPhoneNumber ] [-UserUpn ] [-DefaultProfile ] [-AsJob] - [-NoWait] [-WhatIf] [-Confirm] [] + [-NoWait] [-ProgressAction ] [-WhatIf] [-Confirm] [] ``` ## DESCRIPTION @@ -290,6 +290,21 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -ProgressAction +{{ Fill ProgressAction Description }} + +```yaml +Type: System.Management.Automation.ActionPreference +Parameter Sets: (All) +Aliases: proga + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -ResourceGroupName The name of the resource group. The name is case insensitive.