Skip to content

[PS] Migrate Resource module Authorization part to autorest v4 #27902

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<copyright>Microsoft Corporation. All rights reserved.</copyright>
<tags>Azure ResourceManager ARM PSModule $(service-name)</tags>
<dependencies>
<dependency id="Az.Accounts" version="2.2.3" />
<dependency id="Az.Accounts" version="2.7.5" />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any specific reason why the version should be 2.7.5?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

autogen, I will check

</dependencies>
</metadata>
<files>
Expand Down
27 changes: 27 additions & 0 deletions src/Resources/Authorization.Autorest/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// 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.

using System;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

[assembly: System.Reflection.AssemblyCompanyAttribute("Microsoft")]
[assembly: System.Reflection.AssemblyCopyrightAttribute("Copyright © Microsoft")]
[assembly: System.Reflection.AssemblyProductAttribute("Microsoft Azure PowerShell")]
[assembly: System.Reflection.AssemblyTitleAttribute("Microsoft Azure PowerShell - Authorization")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("8.0.0")]
[assembly: System.Reflection.AssemblyVersionAttribute("8.0.0")]
[assembly: System.Runtime.InteropServices.ComVisibleAttribute(false)]
[assembly: System.CLSCompliantAttribute(false)]

23 changes: 5 additions & 18 deletions src/Resources/Authorization.Autorest/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,8 @@ title: Authorization
namespace: Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization
# remove subject-prefix for all generated cmdlets.
subject-prefix: ''
identity-correction-for-post: true
resourcegroup-append: true
default-exclude-tableview-properties: false

# For new modules, please avoid setting 3.x using the use-extension method and instead, use 4.x as the default option
use-extension:
"@autorest/powershell": "3.x"

directive:
# Swaager bug: The scope should be readonly according to the server response.
- from: swagger-document
Expand All @@ -78,19 +72,11 @@ directive:
}

# Remove "Create", "CreateViaIdentity", "CreateViaIdentityExpanded" syntax variant of the cmdlets. Because of new cmdlet does unsupport.
- where:
verb: New
variant: ^Create$|^CreateViaIdentity$|^CreateViaIdentityExpanded$
# subject: RoleEligibilityScheduleRequest$|RoleManagementPolicyAssignment$
remove: true

# Remove "Update", "UpdateViaIdentity", syntax variant of the cmdlets. Because of update cmdlet does unsupport.
- where:
verb: Update
variant: ^Update$|^UpdateViaIdentity$
subject: RoleManagementPolicy$
variant: ^(Create|Update)(?!.*?(Expanded|JsonFilePath|JsonString))|^CreateViaIdentityExpanded$
remove: true

# The parameter is not friendly and needs to be renamed.
- where:
parameter-name: ^TicketInfoTicketNumber$
Expand All @@ -104,8 +90,9 @@ directive:
# Generate cmdlet for RoleManagementPolicyRule memory object and copy to the custom folder for rename cmdlet(New-AzAuthorizationRoleManagementPolicyRuleObject --> New-AzRoleManagementPolicyRuleObject).
# Then cancel configuration of it.
# - model-cmdlet:
# - RoleManagementPolicyRule

# - model-name: RoleManagementPolicyRule
# cmdlet-name: New-AzRoleManagementPolicyRuleObject

- where:
model-name: EligibleChildResource
set:
Expand Down
15 changes: 12 additions & 3 deletions src/Resources/Authorization.Autorest/docs/Az.Authorization.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
Module Name: Az.Authorization
Module Guid: 5e804a75-47b7-4aac-9e3b-4bbc49a1abca
Module Guid: 29b38940-f692-455e-8683-880403f4bf65
Download Help Link: https://learn.microsoft.com/powershell/module/az.authorization
Help Version: 1.0.0.0
Locale: en-US
Expand Down Expand Up @@ -39,10 +39,10 @@ Get the specified role management policy for a resource scope
Get the specified role management policy assignment for a resource scope

### [New-AzRoleAssignmentScheduleRequest](New-AzRoleAssignmentScheduleRequest.md)
Creates a role assignment schedule request.
Create a role assignment schedule request.

### [New-AzRoleEligibilityScheduleRequest](New-AzRoleEligibilityScheduleRequest.md)
Creates a role eligibility schedule request.
Create a role eligibility schedule request.

### [New-AzRoleManagementPolicyAssignment](New-AzRoleManagementPolicyAssignment.md)
Create a role management policy assignment
Expand All @@ -59,6 +59,15 @@ Cancels a pending role assignment schedule request.
### [Stop-AzRoleEligibilityScheduleRequest](Stop-AzRoleEligibilityScheduleRequest.md)
Cancels a pending role eligibility schedule request.

### [Update-AzRoleAssignmentScheduleRequest](Update-AzRoleAssignmentScheduleRequest.md)
Update a role assignment schedule request.

### [Update-AzRoleEligibilityScheduleRequest](Update-AzRoleEligibilityScheduleRequest.md)
Update a role eligibility schedule request.

### [Update-AzRoleManagementPolicy](Update-AzRoleManagementPolicy.md)
Update a role management policy

### [Update-AzRoleManagementPolicyAssignment](Update-AzRoleManagementPolicyAssignment.md)
Update a role management policy assignment

Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,6 @@ Accept wildcard characters: False

### -InputObject
Identity Parameter
To construct, see NOTES section for INPUTOBJECT properties and create a hash table.

```yaml
Type: Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IAuthorizationIdentity
Expand Down Expand Up @@ -208,7 +207,7 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable

## OUTPUTS

### Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedule
### Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedule

## NOTES

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,6 @@ Accept wildcard characters: False

### -InputObject
Identity Parameter
To construct, see NOTES section for INPUTOBJECT properties and create a hash table.

```yaml
Type: Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IAuthorizationIdentity
Expand Down Expand Up @@ -209,7 +208,7 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable

## OUTPUTS

### Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstance
### Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstance

## NOTES

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,6 @@ Accept wildcard characters: False

### -InputObject
Identity Parameter
To construct, see NOTES section for INPUTOBJECT properties and create a hash table.

```yaml
Type: Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IAuthorizationIdentity
Expand Down Expand Up @@ -193,7 +192,7 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable

## OUTPUTS

### Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequest
### Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequest

## NOTES

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,6 @@ Accept wildcard characters: False

### -InputObject
Identity Parameter
To construct, see NOTES section for INPUTOBJECT properties and create a hash table.

```yaml
Type: Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IAuthorizationIdentity
Expand Down Expand Up @@ -208,7 +207,7 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable

## OUTPUTS

### Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedule
### Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedule

## NOTES

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,6 @@ Accept wildcard characters: False

### -InputObject
Identity Parameter
To construct, see NOTES section for INPUTOBJECT properties and create a hash table.

```yaml
Type: Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IAuthorizationIdentity
Expand Down Expand Up @@ -209,7 +208,7 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable

## OUTPUTS

### Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstance
### Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstance

## NOTES

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,6 @@ Accept wildcard characters: False

### -InputObject
Identity Parameter
To construct, see NOTES section for INPUTOBJECT properties and create a hash table.

```yaml
Type: Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IAuthorizationIdentity
Expand Down Expand Up @@ -193,7 +192,7 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable

## OUTPUTS

### Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequest
### Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequest

## NOTES

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,11 @@ Get the child resources of a resource on which user has eligible access

## SYNTAX

### Get (Default)
```
Get-AzRoleEligibleChildResource -Scope <String> [-Filter <String>] [-DefaultProfile <PSObject>]
[<CommonParameters>]
```

### GetViaIdentity
```
Get-AzRoleEligibleChildResource -InputObject <IAuthorizationIdentity> [-Filter <String>]
[-DefaultProfile <PSObject>] [<CommonParameters>]
```

## DESCRIPTION
Get the child resources of a resource on which user has eligible access

Expand Down Expand Up @@ -99,28 +92,12 @@ Accept pipeline input: False
Accept wildcard characters: False
```

### -InputObject
Identity Parameter
To construct, see NOTES section for INPUTOBJECT properties and create a hash table.

```yaml
Type: Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IAuthorizationIdentity
Parameter Sets: GetViaIdentity
Aliases:

Required: True
Position: Named
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: False
```

### -Scope
The scope of the role management policy.

```yaml
Type: System.String
Parameter Sets: Get
Parameter Sets: (All)
Aliases:

Required: True
Expand All @@ -135,11 +112,9 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable

## INPUTS

### Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IAuthorizationIdentity

## OUTPUTS

### Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IEligibleChildResource
### Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IEligibleChildResource

## NOTES

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ Accept wildcard characters: False

### -InputObject
Identity Parameter
To construct, see NOTES section for INPUTOBJECT properties and create a hash table.

```yaml
Type: Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IAuthorizationIdentity
Expand Down Expand Up @@ -137,7 +136,7 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable

## OUTPUTS

### Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicy
### Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicy

## NOTES

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ Accept wildcard characters: False

### -InputObject
Identity Parameter
To construct, see NOTES section for INPUTOBJECT properties and create a hash table.

```yaml
Type: Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IAuthorizationIdentity
Expand Down Expand Up @@ -139,7 +138,7 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable

## OUTPUTS

### Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignment
### Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignment

## NOTES

Expand Down
Loading