diff --git a/src/Astro/Astro.Autorest/README.md b/src/Astro/Astro.Autorest/README.md index 65bb496920a0..95350ac748e6 100644 --- a/src/Astro/Astro.Autorest/README.md +++ b/src/Astro/Astro.Autorest/README.md @@ -45,7 +45,9 @@ module-version: 0.1.0 # Normally, title is the service name title: Astro subject-prefix: $(service-name) -#this resource cannot be updated by Get-Put operation, so revoke the MSI type upgrade +# 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 disable-transform-identity-type: true directive: @@ -66,4 +68,10 @@ directive: - where: verb: Set remove: true + - where: + verb: New + hide: true + - where: + verb: Update + hide: true ``` diff --git a/src/Astro/Astro.Autorest/custom/New-AzAstroOrganization.ps1 b/src/Astro/Astro.Autorest/custom/New-AzAstroOrganization.ps1 new file mode 100644 index 000000000000..48ed9b4f7b39 --- /dev/null +++ b/src/Astro/Astro.Autorest/custom/New-AzAstroOrganization.ps1 @@ -0,0 +1,311 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# http://www.apache.org/licenses/LICENSE-2.0 +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code +# is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Create a OrganizationResource +.Description +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 + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IOrganizationResource +.Link +https://learn.microsoft.com/powershell/module/az.astro/new-azastroorganization +#> +function New-AzAstroOrganization { + [OutputType([Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IOrganizationResource])] + [CmdletBinding(DefaultParameterSetName = 'CreateExpanded', PositionalBinding = $false, SupportsShouldProcess, ConfirmImpact = 'Medium')] + param( + [Parameter(Mandatory)] + [Alias('OrganizationName')] + [Microsoft.Azure.PowerShell.Cmdlets.Astro.Category('Path')] + [System.String] + # Name of the Organizations resource + ${Name}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Astro.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter()] + [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 = 'CreateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Astro.Category('Body')] + [System.String] + # The geo-location where the resource lives + ${Location}, + + [Parameter(ParameterSetName = 'CreateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Astro.Category('Body')] + [System.String] + # Azure subscription id for the the marketplace offer is purchased from + ${MarketplaceSubscriptionId}, + + [Parameter(ParameterSetName = 'CreateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Astro.Category('Body')] + [System.String] + # Offer Id for the marketplace offer + ${OfferDetailOfferId}, + + [Parameter(ParameterSetName = 'CreateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Astro.Category('Body')] + [System.String] + # Plan Id for the marketplace offer + ${OfferDetailPlanId}, + + [Parameter(ParameterSetName = 'CreateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Astro.Category('Body')] + [System.String] + # Publisher Id for the marketplace offer + ${OfferDetailPublisherId}, + + [Parameter(ParameterSetName = 'CreateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Astro.Category('Body')] + [System.String] + # Email address of the user + ${UserEmailAddress}, + + [Parameter(ParameterSetName = 'CreateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Astro.Category('Body')] + [System.String] + # First name of the user + ${UserFirstName}, + + [Parameter(ParameterSetName = 'CreateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Astro.Category('Body')] + [System.String] + # Last name of the user + ${UserLastName}, + + [Parameter(ParameterSetName='CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Astro.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Decides if enable a system assigned identity for the resource. + ${EnableSystemAssignedIdentity}, + + [Parameter(ParameterSetName = 'CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Astro.PSArgumentCompleterAttribute("PendingFulfillmentStart", "Subscribed", "Suspended", "Unsubscribed")] + [Microsoft.Azure.PowerShell.Cmdlets.Astro.Category('Body')] + [System.String] + # Marketplace subscription status + ${MarketplaceSubscriptionStatus}, + + [Parameter(ParameterSetName = 'CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Astro.Category('Body')] + [System.String] + # Plan Name for the marketplace offer + ${OfferDetailPlanName}, + + [Parameter(ParameterSetName = 'CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Astro.Category('Body')] + [System.String] + # Plan Display Name for the marketplace offer + ${OfferDetailTermId}, + + [Parameter(ParameterSetName = 'CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Astro.Category('Body')] + [System.String] + # Plan Display Name for the marketplace offer + ${OfferDetailTermUnit}, + + [Parameter(ParameterSetName = 'CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Astro.Category('Body')] + [System.String] + # Organization Id in partner's system + ${PartnerOrganizationPropertyOrganizationId}, + + [Parameter(ParameterSetName = 'CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Astro.Category('Body')] + [System.String] + # Organization name in partner's system + ${PartnerOrganizationPropertyOrganizationName}, + + [Parameter(ParameterSetName = 'CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Astro.Category('Body')] + [System.String] + # Workspace Id in partner's system + ${PartnerOrganizationPropertyWorkspaceId}, + + [Parameter(ParameterSetName = 'CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Astro.Category('Body')] + [System.String] + # Workspace name in partner's system + ${PartnerOrganizationPropertyWorkspaceName}, + + [Parameter(ParameterSetName = 'CreateExpanded')] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.Astro.Category('Body')] + [System.String[]] + # List of AAD domains fetched from Microsoft Graph for user. + ${SingleSignOnPropertyAadDomain}, + + [Parameter(ParameterSetName = 'CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Astro.Category('Body')] + [System.String] + # AAD enterprise application Id used to setup SSO + ${SingleSignOnPropertyEnterpriseAppId}, + + [Parameter(ParameterSetName = 'CreateExpanded')] + [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 = 'CreateExpanded')] + [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 = 'CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Astro.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Astro.Runtime.Info(PossibleTypes = ([Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.ITrackedResourceTags]))] + [System.Collections.Hashtable] + # 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] + # User's phone number + ${UserPhoneNumber}, + + [Parameter(ParameterSetName = 'CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Astro.Category('Body')] + [System.String] + # User's principal name + ${UserUpn}, + + [Parameter(ParameterSetName = 'CreateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Astro.Category('Body')] + [System.String] + # Path of Json file supplied to the Create operation + ${JsonFilePath}, + + [Parameter(ParameterSetName = 'CreateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Astro.Category('Body')] + [System.String] + # Json string supplied to the Create 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') ){ + $supportsSystemAssignedIdentity = $PSBoundParameters.ContainsKey('EnableSystemAssignedIdentity') + $supportsUserAssignedIdentity = $PSBoundParameters.ContainsKey("UserAssignedIdentity") -and $UserAssignedIdentity.Length -gt 0 + + # calculate IdentityType + 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") + } + } + Az.Astro.internal\New-AzAstroOrganization @PSBoundParameters + } + +} diff --git a/src/Astro/Astro.Autorest/custom/Update-AzAstroOrganization.ps1 b/src/Astro/Astro.Autorest/custom/Update-AzAstroOrganization.ps1 new file mode 100644 index 000000000000..222d5d2e7213 --- /dev/null +++ b/src/Astro/Astro.Autorest/custom/Update-AzAstroOrganization.ps1 @@ -0,0 +1,305 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# http://www.apache.org/licenses/LICENSE-2.0 +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code +# is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Update a OrganizationResource +.Description +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 + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IAstroIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IOrganizationResource +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [Id ]: Resource identity path + [OrganizationName ]: Name of the Organizations resource + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [SubscriptionId ]: The ID of the target subscription. +.Link +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") + } + } + Az.Astro.internal\Update-AzAstroOrganization @PSBoundParameters + +} +} diff --git a/src/Astro/Astro.Autorest/exports/New-AzAstroOrganization.ps1 b/src/Astro/Astro.Autorest/exports/New-AzAstroOrganization.ps1 index 3f338f875f64..dfc4c3ea1ada 100644 --- a/src/Astro/Astro.Autorest/exports/New-AzAstroOrganization.ps1 +++ b/src/Astro/Astro.Autorest/exports/New-AzAstroOrganization.ps1 @@ -101,11 +101,10 @@ param( ${UserLastName}, [Parameter(ParameterSetName='CreateExpanded')] - [Microsoft.Azure.PowerShell.Cmdlets.Astro.PSArgumentCompleterAttribute("None", "SystemAssigned", "UserAssigned", "SystemAssigned, UserAssigned")] [Microsoft.Azure.PowerShell.Cmdlets.Astro.Category('Body')] - [System.String] - # Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). - ${IdentityType}, + [System.Management.Automation.SwitchParameter] + # Decides if enable a system assigned identity for the resource. + ${EnableSystemAssignedIdentity}, [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Astro.PSArgumentCompleterAttribute("PendingFulfillmentStart", "Subscribed", "Suspended", "Unsubscribed")] @@ -308,9 +307,9 @@ begin { } $mapping = @{ - CreateExpanded = 'Az.Astro.private\New-AzAstroOrganization_CreateExpanded'; - CreateViaJsonFilePath = 'Az.Astro.private\New-AzAstroOrganization_CreateViaJsonFilePath'; - CreateViaJsonString = 'Az.Astro.private\New-AzAstroOrganization_CreateViaJsonString'; + CreateExpanded = 'Az.Astro.custom\New-AzAstroOrganization'; + CreateViaJsonFilePath = 'Az.Astro.custom\New-AzAstroOrganization'; + CreateViaJsonString = 'Az.Astro.custom\New-AzAstroOrganization'; } if (('CreateExpanded', 'CreateViaJsonFilePath', 'CreateViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $testPlayback = $false diff --git a/src/Astro/Astro.Autorest/exports/ProxyCmdletDefinitions.ps1 b/src/Astro/Astro.Autorest/exports/ProxyCmdletDefinitions.ps1 index 4858b03dadb8..0ddb095b270f 100644 --- a/src/Astro/Astro.Autorest/exports/ProxyCmdletDefinitions.ps1 +++ b/src/Astro/Astro.Autorest/exports/ProxyCmdletDefinitions.ps1 @@ -214,6 +214,217 @@ end { } } +<# +.Synopsis +Delete a OrganizationResource +.Description +Delete a OrganizationResource +.Example +Remove-AzAstroOrganization -Name UT.1.test -ResourceGroupName astro-user + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IAstroIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [Id ]: Resource identity path + [OrganizationName ]: Name of the Organizations resource + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [SubscriptionId ]: The ID of the target subscription. +.Link +https://learn.microsoft.com/powershell/module/az.astro/remove-azastroorganization +#> +function Remove-AzAstroOrganization { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Delete', Mandatory)] + [Alias('OrganizationName')] + [Microsoft.Azure.PowerShell.Cmdlets.Astro.Category('Path')] + [System.String] + # Name of the Organizations resource + ${Name}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Astro.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Delete')] + [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='DeleteViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Astro.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IAstroIdentity] + # Identity Parameter + ${InputObject}, + + [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()] + [Microsoft.Azure.PowerShell.Cmdlets.Astro.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [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} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Astro.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.Astro.private\Remove-AzAstroOrganization_Delete'; + DeleteViaIdentity = 'Az.Astro.private\Remove-AzAstroOrganization_DeleteViaIdentity'; + } + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Astro.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Astro.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.Astro.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Astro.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Astro.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + <# .Synopsis Create a OrganizationResource @@ -301,11 +512,10 @@ param( ${UserLastName}, [Parameter(ParameterSetName='CreateExpanded')] - [Microsoft.Azure.PowerShell.Cmdlets.Astro.PSArgumentCompleterAttribute("None", "SystemAssigned", "UserAssigned", "SystemAssigned, UserAssigned")] [Microsoft.Azure.PowerShell.Cmdlets.Astro.Category('Body')] - [System.String] - # Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). - ${IdentityType}, + [System.Management.Automation.SwitchParameter] + # Decides if enable a system assigned identity for the resource. + ${EnableSystemAssignedIdentity}, [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Astro.PSArgumentCompleterAttribute("PendingFulfillmentStart", "Subscribed", "Suspended", "Unsubscribed")] @@ -508,9 +718,9 @@ begin { } $mapping = @{ - CreateExpanded = 'Az.Astro.private\New-AzAstroOrganization_CreateExpanded'; - CreateViaJsonFilePath = 'Az.Astro.private\New-AzAstroOrganization_CreateViaJsonFilePath'; - CreateViaJsonString = 'Az.Astro.private\New-AzAstroOrganization_CreateViaJsonString'; + CreateExpanded = 'Az.Astro.custom\New-AzAstroOrganization'; + CreateViaJsonFilePath = 'Az.Astro.custom\New-AzAstroOrganization'; + CreateViaJsonString = 'Az.Astro.custom\New-AzAstroOrganization'; } if (('CreateExpanded', 'CreateViaJsonFilePath', 'CreateViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $testPlayback = $false @@ -571,217 +781,6 @@ end { } } -<# -.Synopsis -Delete a OrganizationResource -.Description -Delete a OrganizationResource -.Example -Remove-AzAstroOrganization -Name UT.1.test -ResourceGroupName astro-user - -.Inputs -Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IAstroIdentity -.Outputs -System.Boolean -.Notes -COMPLEX PARAMETER PROPERTIES - -To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. - -INPUTOBJECT : Identity Parameter - [Id ]: Resource identity path - [OrganizationName ]: Name of the Organizations resource - [ResourceGroupName ]: The name of the resource group. The name is case insensitive. - [SubscriptionId ]: The ID of the target subscription. -.Link -https://learn.microsoft.com/powershell/module/az.astro/remove-azastroorganization -#> -function Remove-AzAstroOrganization { -[OutputType([System.Boolean])] -[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] -param( - [Parameter(ParameterSetName='Delete', Mandatory)] - [Alias('OrganizationName')] - [Microsoft.Azure.PowerShell.Cmdlets.Astro.Category('Path')] - [System.String] - # Name of the Organizations resource - ${Name}, - - [Parameter(ParameterSetName='Delete', Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.Astro.Category('Path')] - [System.String] - # The name of the resource group. - # The name is case insensitive. - ${ResourceGroupName}, - - [Parameter(ParameterSetName='Delete')] - [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='DeleteViaIdentity', Mandatory, ValueFromPipeline)] - [Microsoft.Azure.PowerShell.Cmdlets.Astro.Category('Path')] - [Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IAstroIdentity] - # Identity Parameter - ${InputObject}, - - [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()] - [Microsoft.Azure.PowerShell.Cmdlets.Astro.Category('Runtime')] - [System.Management.Automation.SwitchParameter] - # Returns true when the command succeeds - ${PassThru}, - - [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} -) - -begin { - try { - $outBuffer = $null - if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { - $PSBoundParameters['OutBuffer'] = 1 - } - $parameterSet = $PSCmdlet.ParameterSetName - - if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() - } - $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId - if ($preTelemetryId -eq '') { - [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() - [Microsoft.Azure.PowerShell.Cmdlets.Astro.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.Astro.private\Remove-AzAstroOrganization_Delete'; - DeleteViaIdentity = 'Az.Astro.private\Remove-AzAstroOrganization_DeleteViaIdentity'; - } - if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Astro.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } - if ($testPlayback) { - $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') - } else { - $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id - } - } - $cmdInfo = Get-Command -Name $mapping[$parameterSet] - [Microsoft.Azure.PowerShell.Cmdlets.Astro.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.Astro.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ - [Microsoft.Azure.PowerShell.Cmdlets.Astro.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) - } - $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) - $scriptCmd = {& $wrappedCmd @PSBoundParameters} - $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) - $steppablePipeline.Begin($PSCmdlet) - } catch { - [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() - throw - } -} - -process { - try { - $steppablePipeline.Process($_) - } catch { - [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() - throw - } - - finally { - $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId - $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets - [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() - } - -} -end { - try { - $steppablePipeline.End() - - [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId - [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets - if ($preTelemetryId -eq '') { - [Microsoft.Azure.PowerShell.Cmdlets.Astro.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) - [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() - } - [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId - - } catch { - [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() - throw - } -} -} - <# .Synopsis Update a OrganizationResource @@ -812,8 +811,8 @@ function Update-AzAstroOrganization { [CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] - [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] [Alias('OrganizationName')] [Microsoft.Azure.PowerShell.Cmdlets.Astro.Category('Path')] [System.String] @@ -821,8 +820,8 @@ param( ${Name}, [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] - [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.Astro.Category('Path')] [System.String] # The name of the resource group. @@ -830,8 +829,8 @@ param( ${ResourceGroupName}, [Parameter(ParameterSetName='UpdateExpanded')] - [Parameter(ParameterSetName='UpdateViaJsonFilePath')] [Parameter(ParameterSetName='UpdateViaJsonString')] + [Parameter(ParameterSetName='UpdateViaJsonFilePath')] [Microsoft.Azure.PowerShell.Cmdlets.Astro.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Astro.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] @@ -846,11 +845,10 @@ param( [Parameter(ParameterSetName='UpdateExpanded')] [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] - [Microsoft.Azure.PowerShell.Cmdlets.Astro.PSArgumentCompleterAttribute("None", "SystemAssigned", "UserAssigned", "SystemAssigned, UserAssigned")] [Microsoft.Azure.PowerShell.Cmdlets.Astro.Category('Body')] - [System.String] - # Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). - ${IdentityType}, + [System.Nullable[System.Boolean]] + # Decides if enable a system assigned identity for the resource. + ${EnableSystemAssignedIdentity}, [Parameter(ParameterSetName='UpdateExpanded')] [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] @@ -962,18 +960,18 @@ param( # 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(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Astro.Category('Body')] + [System.String] + # Path of Json file supplied to the Update operation + ${JsonFilePath}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -1061,12 +1059,12 @@ begin { } $mapping = @{ - UpdateExpanded = 'Az.Astro.private\Update-AzAstroOrganization_UpdateExpanded'; - UpdateViaIdentityExpanded = 'Az.Astro.private\Update-AzAstroOrganization_UpdateViaIdentityExpanded'; - UpdateViaJsonFilePath = 'Az.Astro.private\Update-AzAstroOrganization_UpdateViaJsonFilePath'; - UpdateViaJsonString = 'Az.Astro.private\Update-AzAstroOrganization_UpdateViaJsonString'; + UpdateExpanded = 'Az.Astro.custom\Update-AzAstroOrganization'; + UpdateViaJsonString = 'Az.Astro.custom\Update-AzAstroOrganization'; + UpdateViaJsonFilePath = 'Az.Astro.custom\Update-AzAstroOrganization'; + UpdateViaIdentityExpanded = 'Az.Astro.custom\Update-AzAstroOrganization'; } - if (('UpdateExpanded', 'UpdateViaJsonFilePath', 'UpdateViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { + if (('UpdateExpanded', 'UpdateViaJsonString', 'UpdateViaJsonFilePath') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $testPlayback = $false $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Astro.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } if ($testPlayback) { diff --git a/src/Astro/Astro.Autorest/exports/Update-AzAstroOrganization.ps1 b/src/Astro/Astro.Autorest/exports/Update-AzAstroOrganization.ps1 index f4826a3820a0..49d8f271033f 100644 --- a/src/Astro/Astro.Autorest/exports/Update-AzAstroOrganization.ps1 +++ b/src/Astro/Astro.Autorest/exports/Update-AzAstroOrganization.ps1 @@ -44,8 +44,8 @@ function Update-AzAstroOrganization { [CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] - [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] [Alias('OrganizationName')] [Microsoft.Azure.PowerShell.Cmdlets.Astro.Category('Path')] [System.String] @@ -53,8 +53,8 @@ param( ${Name}, [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] - [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.Astro.Category('Path')] [System.String] # The name of the resource group. @@ -62,8 +62,8 @@ param( ${ResourceGroupName}, [Parameter(ParameterSetName='UpdateExpanded')] - [Parameter(ParameterSetName='UpdateViaJsonFilePath')] [Parameter(ParameterSetName='UpdateViaJsonString')] + [Parameter(ParameterSetName='UpdateViaJsonFilePath')] [Microsoft.Azure.PowerShell.Cmdlets.Astro.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Astro.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] @@ -78,11 +78,10 @@ param( [Parameter(ParameterSetName='UpdateExpanded')] [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] - [Microsoft.Azure.PowerShell.Cmdlets.Astro.PSArgumentCompleterAttribute("None", "SystemAssigned", "UserAssigned", "SystemAssigned, UserAssigned")] [Microsoft.Azure.PowerShell.Cmdlets.Astro.Category('Body')] - [System.String] - # Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). - ${IdentityType}, + [System.Nullable[System.Boolean]] + # Decides if enable a system assigned identity for the resource. + ${EnableSystemAssignedIdentity}, [Parameter(ParameterSetName='UpdateExpanded')] [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] @@ -194,18 +193,18 @@ param( # 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(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Astro.Category('Body')] + [System.String] + # Path of Json file supplied to the Update operation + ${JsonFilePath}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -293,12 +292,12 @@ begin { } $mapping = @{ - UpdateExpanded = 'Az.Astro.private\Update-AzAstroOrganization_UpdateExpanded'; - UpdateViaIdentityExpanded = 'Az.Astro.private\Update-AzAstroOrganization_UpdateViaIdentityExpanded'; - UpdateViaJsonFilePath = 'Az.Astro.private\Update-AzAstroOrganization_UpdateViaJsonFilePath'; - UpdateViaJsonString = 'Az.Astro.private\Update-AzAstroOrganization_UpdateViaJsonString'; + UpdateExpanded = 'Az.Astro.custom\Update-AzAstroOrganization'; + UpdateViaJsonString = 'Az.Astro.custom\Update-AzAstroOrganization'; + UpdateViaJsonFilePath = 'Az.Astro.custom\Update-AzAstroOrganization'; + UpdateViaIdentityExpanded = 'Az.Astro.custom\Update-AzAstroOrganization'; } - if (('UpdateExpanded', 'UpdateViaJsonFilePath', 'UpdateViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { + if (('UpdateExpanded', 'UpdateViaJsonString', 'UpdateViaJsonFilePath') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $testPlayback = $false $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Astro.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } if ($testPlayback) { diff --git a/src/Astro/Astro.Autorest/generated/cmdlets/NewAzAstroOrganization_CreateExpanded.cs b/src/Astro/Astro.Autorest/generated/cmdlets/NewAzAstroOrganization_CreateExpanded.cs index 051d2a3b513e..943422efae8d 100644 --- a/src/Astro/Astro.Autorest/generated/cmdlets/NewAzAstroOrganization_CreateExpanded.cs +++ b/src/Astro/Astro.Autorest/generated/cmdlets/NewAzAstroOrganization_CreateExpanded.cs @@ -14,6 +14,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Astro.Cmdlets /// /// [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")] diff --git a/src/Astro/Astro.Autorest/generated/cmdlets/NewAzAstroOrganization_CreateViaJsonFilePath.cs b/src/Astro/Astro.Autorest/generated/cmdlets/NewAzAstroOrganization_CreateViaJsonFilePath.cs index e902c2e58c42..77eab441445e 100644 --- a/src/Astro/Astro.Autorest/generated/cmdlets/NewAzAstroOrganization_CreateViaJsonFilePath.cs +++ b/src/Astro/Astro.Autorest/generated/cmdlets/NewAzAstroOrganization_CreateViaJsonFilePath.cs @@ -14,6 +14,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Astro.Cmdlets /// /// [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")] diff --git a/src/Astro/Astro.Autorest/generated/cmdlets/NewAzAstroOrganization_CreateViaJsonString.cs b/src/Astro/Astro.Autorest/generated/cmdlets/NewAzAstroOrganization_CreateViaJsonString.cs index 1a3d9ba6a670..ca26deb4dbd4 100644 --- a/src/Astro/Astro.Autorest/generated/cmdlets/NewAzAstroOrganization_CreateViaJsonString.cs +++ b/src/Astro/Astro.Autorest/generated/cmdlets/NewAzAstroOrganization_CreateViaJsonString.cs @@ -14,6 +14,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Astro.Cmdlets /// /// [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")] diff --git a/src/Astro/Astro.Autorest/generated/cmdlets/UpdateAzAstroOrganization_UpdateExpanded.cs b/src/Astro/Astro.Autorest/generated/cmdlets/UpdateAzAstroOrganization_UpdateExpanded.cs index ffb796c0ecad..b92d01ece271 100644 --- a/src/Astro/Astro.Autorest/generated/cmdlets/UpdateAzAstroOrganization_UpdateExpanded.cs +++ b/src/Astro/Astro.Autorest/generated/cmdlets/UpdateAzAstroOrganization_UpdateExpanded.cs @@ -14,6 +14,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Astro.Cmdlets /// /// [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")] diff --git a/src/Astro/Astro.Autorest/generated/cmdlets/UpdateAzAstroOrganization_UpdateViaIdentityExpanded.cs b/src/Astro/Astro.Autorest/generated/cmdlets/UpdateAzAstroOrganization_UpdateViaIdentityExpanded.cs index 51b8836e3159..d025a380c059 100644 --- a/src/Astro/Astro.Autorest/generated/cmdlets/UpdateAzAstroOrganization_UpdateViaIdentityExpanded.cs +++ b/src/Astro/Astro.Autorest/generated/cmdlets/UpdateAzAstroOrganization_UpdateViaIdentityExpanded.cs @@ -14,6 +14,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Astro.Cmdlets /// /// [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")] diff --git a/src/Astro/Astro.Autorest/generated/cmdlets/UpdateAzAstroOrganization_UpdateViaJsonFilePath.cs b/src/Astro/Astro.Autorest/generated/cmdlets/UpdateAzAstroOrganization_UpdateViaJsonFilePath.cs index 23c648a16947..70e6d7bed8cf 100644 --- a/src/Astro/Astro.Autorest/generated/cmdlets/UpdateAzAstroOrganization_UpdateViaJsonFilePath.cs +++ b/src/Astro/Astro.Autorest/generated/cmdlets/UpdateAzAstroOrganization_UpdateViaJsonFilePath.cs @@ -14,6 +14,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Astro.Cmdlets /// /// [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")] diff --git a/src/Astro/Astro.Autorest/generated/cmdlets/UpdateAzAstroOrganization_UpdateViaJsonString.cs b/src/Astro/Astro.Autorest/generated/cmdlets/UpdateAzAstroOrganization_UpdateViaJsonString.cs index fe8dba9fcc7f..e6472e4513b4 100644 --- a/src/Astro/Astro.Autorest/generated/cmdlets/UpdateAzAstroOrganization_UpdateViaJsonString.cs +++ b/src/Astro/Astro.Autorest/generated/cmdlets/UpdateAzAstroOrganization_UpdateViaJsonString.cs @@ -14,6 +14,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Astro.Cmdlets /// /// [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")] diff --git a/src/Astro/Astro.Autorest/help/New-AzAstroOrganization.md b/src/Astro/Astro.Autorest/help/New-AzAstroOrganization.md index 00f986cc8e12..40c3257e82a4 100644 --- a/src/Astro/Astro.Autorest/help/New-AzAstroOrganization.md +++ b/src/Astro/Astro.Autorest/help/New-AzAstroOrganization.md @@ -17,7 +17,7 @@ Create a OrganizationResource New-AzAstroOrganization -Name -ResourceGroupName -Location -MarketplaceSubscriptionId -OfferDetailOfferId -OfferDetailPlanId -OfferDetailPublisherId -UserEmailAddress -UserFirstName -UserLastName - [-SubscriptionId ] [-IdentityType ] [-MarketplaceSubscriptionStatus ] + [-SubscriptionId ] [-EnableSystemAssignedIdentity] [-MarketplaceSubscriptionStatus ] [-OfferDetailPlanName ] [-OfferDetailTermId ] [-OfferDetailTermUnit ] [-PartnerOrganizationPropertyOrganizationId ] [-PartnerOrganizationPropertyOrganizationName ] [-PartnerOrganizationPropertyWorkspaceId ] [-PartnerOrganizationPropertyWorkspaceName ] @@ -130,11 +130,11 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -IdentityType -Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). +### -EnableSystemAssignedIdentity +Decides if enable a system assigned identity for the resource. ```yaml -Type: System.String +Type: System.Management.Automation.SwitchParameter Parameter Sets: CreateExpanded Aliases: diff --git a/src/Astro/Astro.Autorest/help/Update-AzAstroOrganization.md b/src/Astro/Astro.Autorest/help/Update-AzAstroOrganization.md index 6205b6d38981..84d1e4849c99 100644 --- a/src/Astro/Astro.Autorest/help/Update-AzAstroOrganization.md +++ b/src/Astro/Astro.Autorest/help/Update-AzAstroOrganization.md @@ -15,7 +15,7 @@ Update a OrganizationResource ### UpdateExpanded (Default) ``` Update-AzAstroOrganization -Name -ResourceGroupName [-SubscriptionId ] - [-IdentityType ] [-PartnerOrganizationPropertyOrganizationId ] + [-EnableSystemAssignedIdentity ] [-PartnerOrganizationPropertyOrganizationId ] [-PartnerOrganizationPropertyOrganizationName ] [-PartnerOrganizationPropertyWorkspaceId ] [-PartnerOrganizationPropertyWorkspaceName ] [-SingleSignOnPropertyAadDomain ] [-SingleSignOnPropertyEnterpriseAppId ] [-SingleSignOnPropertySingleSignOnState ] @@ -26,7 +26,7 @@ Update-AzAstroOrganization -Name -ResourceGroupName [-Subscrip ### UpdateViaIdentityExpanded ``` -Update-AzAstroOrganization -InputObject [-IdentityType ] +Update-AzAstroOrganization -InputObject [-EnableSystemAssignedIdentity ] [-PartnerOrganizationPropertyOrganizationId ] [-PartnerOrganizationPropertyOrganizationName ] [-PartnerOrganizationPropertyWorkspaceId ] [-PartnerOrganizationPropertyWorkspaceName ] [-SingleSignOnPropertyAadDomain ] [-SingleSignOnPropertyEnterpriseAppId ] @@ -139,11 +139,11 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -IdentityType -Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). +### -EnableSystemAssignedIdentity +Decides if enable a system assigned identity for the resource. ```yaml -Type: System.String +Type: System.Nullable`1[[System.Boolean, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]] Parameter Sets: UpdateExpanded, UpdateViaIdentityExpanded Aliases: diff --git a/src/Astro/Astro.Autorest/internal/New-AzAstroOrganization.ps1 b/src/Astro/Astro.Autorest/internal/New-AzAstroOrganization.ps1 new file mode 100644 index 000000000000..e41d5a696023 --- /dev/null +++ b/src/Astro/Astro.Autorest/internal/New-AzAstroOrganization.ps1 @@ -0,0 +1,336 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# http://www.apache.org/licenses/LICENSE-2.0 +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code +# is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Create a OrganizationResource +.Description +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 + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IOrganizationResource +.Link +https://learn.microsoft.com/powershell/module/az.astro/new-azastroorganization +#> +function New-AzAstroOrganization { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IOrganizationResource])] +[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Alias('OrganizationName')] + [Microsoft.Azure.PowerShell.Cmdlets.Astro.Category('Path')] + [System.String] + # Name of the Organizations resource + ${Name}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Astro.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter()] + [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='CreateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Astro.Category('Body')] + [System.String] + # The geo-location where the resource lives + ${Location}, + + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Astro.Category('Body')] + [System.String] + # Azure subscription id for the the marketplace offer is purchased from + ${MarketplaceSubscriptionId}, + + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Astro.Category('Body')] + [System.String] + # Offer Id for the marketplace offer + ${OfferDetailOfferId}, + + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Astro.Category('Body')] + [System.String] + # Plan Id for the marketplace offer + ${OfferDetailPlanId}, + + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Astro.Category('Body')] + [System.String] + # Publisher Id for the marketplace offer + ${OfferDetailPublisherId}, + + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Astro.Category('Body')] + [System.String] + # Email address of the user + ${UserEmailAddress}, + + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Astro.Category('Body')] + [System.String] + # First name of the user + ${UserFirstName}, + + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Astro.Category('Body')] + [System.String] + # Last name of the user + ${UserLastName}, + + [Parameter(ParameterSetName='CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Astro.PSArgumentCompleterAttribute("None", "SystemAssigned", "UserAssigned", "SystemAssigned, UserAssigned")] + [Microsoft.Azure.PowerShell.Cmdlets.Astro.Category('Body')] + [System.String] + # Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). + ${IdentityType}, + + [Parameter(ParameterSetName='CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Astro.PSArgumentCompleterAttribute("PendingFulfillmentStart", "Subscribed", "Suspended", "Unsubscribed")] + [Microsoft.Azure.PowerShell.Cmdlets.Astro.Category('Body')] + [System.String] + # Marketplace subscription status + ${MarketplaceSubscriptionStatus}, + + [Parameter(ParameterSetName='CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Astro.Category('Body')] + [System.String] + # Plan Name for the marketplace offer + ${OfferDetailPlanName}, + + [Parameter(ParameterSetName='CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Astro.Category('Body')] + [System.String] + # Plan Display Name for the marketplace offer + ${OfferDetailTermId}, + + [Parameter(ParameterSetName='CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Astro.Category('Body')] + [System.String] + # Plan Display Name for the marketplace offer + ${OfferDetailTermUnit}, + + [Parameter(ParameterSetName='CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Astro.Category('Body')] + [System.String] + # Organization Id in partner's system + ${PartnerOrganizationPropertyOrganizationId}, + + [Parameter(ParameterSetName='CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Astro.Category('Body')] + [System.String] + # Organization name in partner's system + ${PartnerOrganizationPropertyOrganizationName}, + + [Parameter(ParameterSetName='CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Astro.Category('Body')] + [System.String] + # Workspace Id in partner's system + ${PartnerOrganizationPropertyWorkspaceId}, + + [Parameter(ParameterSetName='CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Astro.Category('Body')] + [System.String] + # Workspace name in partner's system + ${PartnerOrganizationPropertyWorkspaceName}, + + [Parameter(ParameterSetName='CreateExpanded')] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.Astro.Category('Body')] + [System.String[]] + # List of AAD domains fetched from Microsoft Graph for user. + ${SingleSignOnPropertyAadDomain}, + + [Parameter(ParameterSetName='CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Astro.Category('Body')] + [System.String] + # AAD enterprise application Id used to setup SSO + ${SingleSignOnPropertyEnterpriseAppId}, + + [Parameter(ParameterSetName='CreateExpanded')] + [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='CreateExpanded')] + [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='CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Astro.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Astro.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.ITrackedResourceTags]))] + [System.Collections.Hashtable] + # 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] + # User's phone number + ${UserPhoneNumber}, + + [Parameter(ParameterSetName='CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Astro.Category('Body')] + [System.String] + # User's principal name + ${UserUpn}, + + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Astro.Category('Body')] + [System.String] + # Path of Json file supplied to the Create operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Astro.Category('Body')] + [System.String] + # Json string supplied to the Create 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} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + $mapping = @{ + CreateExpanded = 'Az.Astro.private\New-AzAstroOrganization_CreateExpanded'; + CreateViaJsonFilePath = 'Az.Astro.private\New-AzAstroOrganization_CreateViaJsonFilePath'; + CreateViaJsonString = 'Az.Astro.private\New-AzAstroOrganization_CreateViaJsonString'; + } + if (('CreateExpanded', 'CreateViaJsonFilePath', 'CreateViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Astro.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + + $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/Astro/Astro.Autorest/internal/ProxyCmdletDefinitions.ps1 b/src/Astro/Astro.Autorest/internal/ProxyCmdletDefinitions.ps1 index d6e570041ec7..55f1c3fc6324 100644 --- a/src/Astro/Astro.Autorest/internal/ProxyCmdletDefinitions.ps1 +++ b/src/Astro/Astro.Autorest/internal/ProxyCmdletDefinitions.ps1 @@ -123,3 +123,631 @@ end { } } } + +<# +.Synopsis +Create a OrganizationResource +.Description +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 + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IOrganizationResource +.Link +https://learn.microsoft.com/powershell/module/az.astro/new-azastroorganization +#> +function New-AzAstroOrganization { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IOrganizationResource])] +[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Alias('OrganizationName')] + [Microsoft.Azure.PowerShell.Cmdlets.Astro.Category('Path')] + [System.String] + # Name of the Organizations resource + ${Name}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Astro.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter()] + [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='CreateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Astro.Category('Body')] + [System.String] + # The geo-location where the resource lives + ${Location}, + + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Astro.Category('Body')] + [System.String] + # Azure subscription id for the the marketplace offer is purchased from + ${MarketplaceSubscriptionId}, + + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Astro.Category('Body')] + [System.String] + # Offer Id for the marketplace offer + ${OfferDetailOfferId}, + + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Astro.Category('Body')] + [System.String] + # Plan Id for the marketplace offer + ${OfferDetailPlanId}, + + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Astro.Category('Body')] + [System.String] + # Publisher Id for the marketplace offer + ${OfferDetailPublisherId}, + + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Astro.Category('Body')] + [System.String] + # Email address of the user + ${UserEmailAddress}, + + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Astro.Category('Body')] + [System.String] + # First name of the user + ${UserFirstName}, + + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Astro.Category('Body')] + [System.String] + # Last name of the user + ${UserLastName}, + + [Parameter(ParameterSetName='CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Astro.PSArgumentCompleterAttribute("None", "SystemAssigned", "UserAssigned", "SystemAssigned, UserAssigned")] + [Microsoft.Azure.PowerShell.Cmdlets.Astro.Category('Body')] + [System.String] + # Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). + ${IdentityType}, + + [Parameter(ParameterSetName='CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Astro.PSArgumentCompleterAttribute("PendingFulfillmentStart", "Subscribed", "Suspended", "Unsubscribed")] + [Microsoft.Azure.PowerShell.Cmdlets.Astro.Category('Body')] + [System.String] + # Marketplace subscription status + ${MarketplaceSubscriptionStatus}, + + [Parameter(ParameterSetName='CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Astro.Category('Body')] + [System.String] + # Plan Name for the marketplace offer + ${OfferDetailPlanName}, + + [Parameter(ParameterSetName='CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Astro.Category('Body')] + [System.String] + # Plan Display Name for the marketplace offer + ${OfferDetailTermId}, + + [Parameter(ParameterSetName='CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Astro.Category('Body')] + [System.String] + # Plan Display Name for the marketplace offer + ${OfferDetailTermUnit}, + + [Parameter(ParameterSetName='CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Astro.Category('Body')] + [System.String] + # Organization Id in partner's system + ${PartnerOrganizationPropertyOrganizationId}, + + [Parameter(ParameterSetName='CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Astro.Category('Body')] + [System.String] + # Organization name in partner's system + ${PartnerOrganizationPropertyOrganizationName}, + + [Parameter(ParameterSetName='CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Astro.Category('Body')] + [System.String] + # Workspace Id in partner's system + ${PartnerOrganizationPropertyWorkspaceId}, + + [Parameter(ParameterSetName='CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Astro.Category('Body')] + [System.String] + # Workspace name in partner's system + ${PartnerOrganizationPropertyWorkspaceName}, + + [Parameter(ParameterSetName='CreateExpanded')] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.Astro.Category('Body')] + [System.String[]] + # List of AAD domains fetched from Microsoft Graph for user. + ${SingleSignOnPropertyAadDomain}, + + [Parameter(ParameterSetName='CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Astro.Category('Body')] + [System.String] + # AAD enterprise application Id used to setup SSO + ${SingleSignOnPropertyEnterpriseAppId}, + + [Parameter(ParameterSetName='CreateExpanded')] + [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='CreateExpanded')] + [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='CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Astro.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Astro.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.ITrackedResourceTags]))] + [System.Collections.Hashtable] + # 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] + # User's phone number + ${UserPhoneNumber}, + + [Parameter(ParameterSetName='CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Astro.Category('Body')] + [System.String] + # User's principal name + ${UserUpn}, + + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Astro.Category('Body')] + [System.String] + # Path of Json file supplied to the Create operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Astro.Category('Body')] + [System.String] + # Json string supplied to the Create 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} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + $mapping = @{ + CreateExpanded = 'Az.Astro.private\New-AzAstroOrganization_CreateExpanded'; + CreateViaJsonFilePath = 'Az.Astro.private\New-AzAstroOrganization_CreateViaJsonFilePath'; + CreateViaJsonString = 'Az.Astro.private\New-AzAstroOrganization_CreateViaJsonString'; + } + if (('CreateExpanded', 'CreateViaJsonFilePath', 'CreateViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Astro.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + + $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 +Update a OrganizationResource +.Description +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 + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IAstroIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IOrganizationResource +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [Id ]: Resource identity path + [OrganizationName ]: Name of the Organizations resource + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [SubscriptionId ]: The ID of the target subscription. +.Link +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.PSArgumentCompleterAttribute("None", "SystemAssigned", "UserAssigned", "SystemAssigned, UserAssigned")] + [Microsoft.Azure.PowerShell.Cmdlets.Astro.Category('Body')] + [System.String] + # 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')] + [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} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + $mapping = @{ + UpdateExpanded = 'Az.Astro.private\Update-AzAstroOrganization_UpdateExpanded'; + UpdateViaIdentityExpanded = 'Az.Astro.private\Update-AzAstroOrganization_UpdateViaIdentityExpanded'; + UpdateViaJsonFilePath = 'Az.Astro.private\Update-AzAstroOrganization_UpdateViaJsonFilePath'; + UpdateViaJsonString = 'Az.Astro.private\Update-AzAstroOrganization_UpdateViaJsonString'; + } + if (('UpdateExpanded', 'UpdateViaJsonFilePath', 'UpdateViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Astro.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + + $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/Astro/Astro.Autorest/internal/Update-AzAstroOrganization.ps1 b/src/Astro/Astro.Autorest/internal/Update-AzAstroOrganization.ps1 new file mode 100644 index 000000000000..fc67a33e95fa --- /dev/null +++ b/src/Astro/Astro.Autorest/internal/Update-AzAstroOrganization.ps1 @@ -0,0 +1,322 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# http://www.apache.org/licenses/LICENSE-2.0 +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code +# is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Update a OrganizationResource +.Description +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 + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IAstroIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IOrganizationResource +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [Id ]: Resource identity path + [OrganizationName ]: Name of the Organizations resource + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [SubscriptionId ]: The ID of the target subscription. +.Link +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.PSArgumentCompleterAttribute("None", "SystemAssigned", "UserAssigned", "SystemAssigned, UserAssigned")] + [Microsoft.Azure.PowerShell.Cmdlets.Astro.Category('Body')] + [System.String] + # 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')] + [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} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + $mapping = @{ + UpdateExpanded = 'Az.Astro.private\Update-AzAstroOrganization_UpdateExpanded'; + UpdateViaIdentityExpanded = 'Az.Astro.private\Update-AzAstroOrganization_UpdateViaIdentityExpanded'; + UpdateViaJsonFilePath = 'Az.Astro.private\Update-AzAstroOrganization_UpdateViaJsonFilePath'; + UpdateViaJsonString = 'Az.Astro.private\Update-AzAstroOrganization_UpdateViaJsonString'; + } + if (('UpdateExpanded', 'UpdateViaJsonFilePath', 'UpdateViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Astro.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + + $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/Astro/Astro/Az.Astro.psd1 b/src/Astro/Astro/Az.Astro.psd1 index 89d4f9c69f76..e130e175c273 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/20/2024 +# Generated on: 8/26/2024 # @{ diff --git a/src/Astro/Astro/help/New-AzAstroOrganization.md b/src/Astro/Astro/help/New-AzAstroOrganization.md index a8460a916715..d7bda1ade719 100644 --- a/src/Astro/Astro/help/New-AzAstroOrganization.md +++ b/src/Astro/Astro/help/New-AzAstroOrganization.md @@ -17,7 +17,7 @@ Create a OrganizationResource New-AzAstroOrganization -Name -ResourceGroupName [-SubscriptionId ] -Location -MarketplaceSubscriptionId -OfferDetailOfferId -OfferDetailPlanId -OfferDetailPublisherId -UserEmailAddress - -UserFirstName -UserLastName [-IdentityType ] + -UserFirstName -UserLastName [-EnableSystemAssignedIdentity] [-MarketplaceSubscriptionStatus ] [-OfferDetailPlanName ] [-OfferDetailTermId ] [-OfferDetailTermUnit ] [-PartnerOrganizationPropertyOrganizationId ] [-PartnerOrganizationPropertyOrganizationName ] [-PartnerOrganizationPropertyWorkspaceId ] @@ -131,11 +131,11 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -IdentityType -Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). +### -EnableSystemAssignedIdentity +Decides if enable a system assigned identity for the resource. ```yaml -Type: System.String +Type: System.Management.Automation.SwitchParameter Parameter Sets: CreateExpanded Aliases: diff --git a/src/Astro/Astro/help/Update-AzAstroOrganization.md b/src/Astro/Astro/help/Update-AzAstroOrganization.md index 49d4518e05a7..c5d0bd0460f1 100644 --- a/src/Astro/Astro/help/Update-AzAstroOrganization.md +++ b/src/Astro/Astro/help/Update-AzAstroOrganization.md @@ -15,7 +15,7 @@ Update a OrganizationResource ### UpdateExpanded (Default) ``` Update-AzAstroOrganization -Name -ResourceGroupName [-SubscriptionId ] - [-IdentityType ] [-PartnerOrganizationPropertyOrganizationId ] + [-EnableSystemAssignedIdentity ] [-PartnerOrganizationPropertyOrganizationId ] [-PartnerOrganizationPropertyOrganizationName ] [-PartnerOrganizationPropertyWorkspaceId ] [-PartnerOrganizationPropertyWorkspaceName ] [-SingleSignOnPropertyAadDomain ] [-SingleSignOnPropertyEnterpriseAppId ] [-SingleSignOnPropertySingleSignOnState ] @@ -25,23 +25,23 @@ Update-AzAstroOrganization -Name -ResourceGroupName [-Subscrip [-WhatIf] [-Confirm] [] ``` -### UpdateViaJsonString +### UpdateViaJsonFilePath ``` Update-AzAstroOrganization -Name -ResourceGroupName [-SubscriptionId ] - -JsonString [-DefaultProfile ] [-AsJob] [-NoWait] [-ProgressAction ] + -JsonFilePath [-DefaultProfile ] [-AsJob] [-NoWait] [-ProgressAction ] [-WhatIf] [-Confirm] [] ``` -### UpdateViaJsonFilePath +### UpdateViaJsonString ``` Update-AzAstroOrganization -Name -ResourceGroupName [-SubscriptionId ] - -JsonFilePath [-DefaultProfile ] [-AsJob] [-NoWait] [-ProgressAction ] + -JsonString [-DefaultProfile ] [-AsJob] [-NoWait] [-ProgressAction ] [-WhatIf] [-Confirm] [] ``` ### UpdateViaIdentityExpanded ``` -Update-AzAstroOrganization -InputObject [-IdentityType ] +Update-AzAstroOrganization -InputObject [-EnableSystemAssignedIdentity ] [-PartnerOrganizationPropertyOrganizationId ] [-PartnerOrganizationPropertyOrganizationName ] [-PartnerOrganizationPropertyWorkspaceId ] [-PartnerOrganizationPropertyWorkspaceName ] [-SingleSignOnPropertyAadDomain ] [-SingleSignOnPropertyEnterpriseAppId ] @@ -140,11 +140,11 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -IdentityType -Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). +### -EnableSystemAssignedIdentity +Decides if enable a system assigned identity for the resource. ```yaml -Type: System.String +Type: System.Nullable`1[System.Boolean] Parameter Sets: UpdateExpanded, UpdateViaIdentityExpanded Aliases: @@ -205,7 +205,7 @@ Name of the Organizations resource ```yaml Type: System.String -Parameter Sets: UpdateExpanded, UpdateViaJsonString, UpdateViaJsonFilePath +Parameter Sets: UpdateExpanded, UpdateViaJsonFilePath, UpdateViaJsonString Aliases: OrganizationName Required: True @@ -311,7 +311,7 @@ The name is case insensitive. ```yaml Type: System.String -Parameter Sets: UpdateExpanded, UpdateViaJsonString, UpdateViaJsonFilePath +Parameter Sets: UpdateExpanded, UpdateViaJsonFilePath, UpdateViaJsonString Aliases: Required: True @@ -386,7 +386,7 @@ The ID of the target subscription. ```yaml Type: System.String -Parameter Sets: UpdateExpanded, UpdateViaJsonString, UpdateViaJsonFilePath +Parameter Sets: UpdateExpanded, UpdateViaJsonFilePath, UpdateViaJsonString Aliases: Required: False