Skip to content

Commit ce2e1b7

Browse files
committed
Migrate ManagedServices module to autorest v4
1 parent f5d8429 commit ce2e1b7

File tree

37 files changed

+1124
-158
lines changed

37 files changed

+1124
-158
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
2+
// Licensed under the Apache License, Version 2.0 (the ""License"");
3+
// you may not use this file except in compliance with the License.
4+
// You may obtain a copy of the License at
5+
// http://www.apache.org/licenses/LICENSE-2.0
6+
// Unless required by applicable law or agreed to in writing, software
7+
// distributed under the License is distributed on an ""AS IS"" BASIS,
8+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
9+
// See the License for the specific language governing permissions and
10+
// limitations under the License.
11+
// Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code
12+
// is regenerated.
13+
14+
using System;
15+
using System.Reflection;
16+
using System.Runtime.CompilerServices;
17+
using System.Runtime.InteropServices;
18+
19+
[assembly: System.Reflection.AssemblyCompanyAttribute("Microsoft")]
20+
[assembly: System.Reflection.AssemblyCopyrightAttribute("Copyright © Microsoft")]
21+
[assembly: System.Reflection.AssemblyProductAttribute("Microsoft Azure PowerShell")]
22+
[assembly: System.Reflection.AssemblyTitleAttribute("Microsoft Azure PowerShell - ManagedServices")]
23+
[assembly: System.Reflection.AssemblyFileVersionAttribute("3.1.0")]
24+
[assembly: System.Reflection.AssemblyVersionAttribute("3.1.0")]
25+
[assembly: System.Runtime.InteropServices.ComVisibleAttribute(false)]
26+
[assembly: System.CLSCompliantAttribute(false)]
27+

src/ManagedServices/ManagedServices.Autorest/README.md

Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,6 @@ title: ManagedServices
3838
module-version: 2.0.0
3939
subject-prefix: $(service-name)
4040

41-
identity-correction-for-post: true
42-
resourcegroup-append: true
43-
nested-object-to-string: true
44-
45-
# For new modules, please avoid setting 3.x using the use-extension method and instead, use 4.x as the default option
46-
use-extension:
47-
"@autorest/powershell": "3.x"
48-
4941
directive:
5042

5143
# Remove unnecessary cmdlet.
@@ -61,8 +53,7 @@ directive:
6153

6254
# Remove variant of the cmdlet
6355
- where:
64-
verb: New
65-
variant: ^Create$|^CreateViaIdentity$|^CreateViaIdentityExpanded$
56+
variant: ^(Create|Update)(?!.*?(Expanded|JsonFilePath|JsonString))|^CreateViaIdentityExpanded$
6657
remove: true
6758

6859
# Hide cmdlet
@@ -84,18 +75,12 @@ directive:
8475
default:
8576
script: '"subscriptions/" + (Get-AzContext).Subscription.Id'
8677

87-
# The regex(^/(?<scope>[^/]+)/) mathch failed because the scope inlcude '/' character.
88-
# Replace regex to fixed it.
89-
- from: source-file-csharp
90-
where: $
91-
transform: $ = $.replace(/global::System.Text.RegularExpressions.Regex\(\"\^\/\(\?\<scope\>\[\^\/\]\+\)/g, 'global::System.Text.RegularExpressions.Regex("^/(?<scope>.+)');
92-
9378
# Generate memory object as parameter of the cmelet.
9479
- model-cmdlet:
95-
- Authorization
96-
- EligibleApprover
80+
- model-name: Authorization
81+
- model-name: EligibleApprover
9782
# Need custom that add ArgumentCompleterAttribute for JustInTimeAccessPolicyMultiFactorAuthProvider parameter.
98-
# - EligibleAuthorization
83+
# - model-name: EligibleAuthorization
9984

10085
# The function invalid for memory cmdlet.
10186
# Custom cmdlet.

src/ManagedServices/ManagedServices.Autorest/custom/Get-AzManagedServicesMarketplaceDefinition.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ PS C:\> {{ Add code here }}
3030
.Inputs
3131
Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Models.IManagedServicesIdentity
3232
.Outputs
33-
Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Models.Api20200201Preview.IMarketplaceRegistrationDefinition
33+
Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Models.IMarketplaceRegistrationDefinition
3434
.Notes
3535
COMPLEX PARAMETER PROPERTIES
3636
@@ -46,7 +46,7 @@ INPUTOBJECT <IManagedServicesIdentity>: Identity Parameter
4646
https://learn.microsoft.com/powershell/module/az.managedservices/get-azmanagedservicesmarketplacedefinition
4747
#>
4848
function Get-AzManagedServicesMarketplaceDefinition {
49-
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Models.Api20200201Preview.IMarketplaceRegistrationDefinition])]
49+
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Models.IMarketplaceRegistrationDefinition])]
5050
[CmdletBinding(DefaultParameterSetName='ListWithScope', PositionalBinding=$false)]
5151
param(
5252
[Parameter(ParameterSetName='GetWithScope', Mandatory)]

src/ManagedServices/ManagedServices.Autorest/custom/New-AzManagedServicesEligibleAuthorizationObject.ps1

Lines changed: 30 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,45 @@
11

2-
# ----------------------------------------------------------------------------------
3-
#
4-
# Copyright Microsoft Corporation
5-
# Licensed under the Apache License, Version 2.0 (the \"License\");
6-
# you may not use this file except in compliance with the License.
7-
# You may obtain a copy of the License at
8-
# http://www.apache.org/licenses/LICENSE-2.0
9-
# Unless required by applicable law or agreed to in writing, software
10-
# distributed under the License is distributed on an \"AS IS\" BASIS,
11-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12-
# See the License for the specific language governing permissions and
13-
# limitations under the License.
14-
# ----------------------------------------------------------------------------------
2+
# ----------------------------------------------------------------------------------
3+
# Copyright (c) Microsoft Corporation. All rights reserved.
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
# Unless required by applicable law or agreed to in writing, software
9+
# distributed under the License is distributed on an "AS IS" BASIS,
10+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
# See the License for the specific language governing permissions and
12+
# limitations under the License.
13+
# Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code
14+
# is regenerated.
15+
# ----------------------------------------------------------------------------------
1516

16-
<#
17-
.Synopsis
18-
Create a in-memory object for EligibleAuthorization
19-
.Description
20-
Create a in-memory object for EligibleAuthorization
17+
<#
18+
.Synopsis
19+
Create an in-memory object for EligibleAuthorization.
20+
.Description
21+
Create an in-memory object for EligibleAuthorization.
2122
22-
.Outputs
23-
Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Models.Api20200201Preview.EligibleAuthorization
24-
.Link
25-
https://learn.microsoft.com/powershell/module/az.ManagedServices/new-AzManagedServicesEligibleAuthorizationObject
26-
#>
23+
.Outputs
24+
Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Models.EligibleAuthorization
25+
.Link
26+
https://learn.microsoft.com/powershell/module/az.ManagedServices/new-AzManagedServicesEligibleAuthorizationObject
27+
#>
2728
function New-AzManagedServicesEligibleAuthorizationObject {
28-
[OutputType('Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Models.Api20200201Preview.EligibleAuthorization')]
29+
[Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.ModelCmdletAttribute()]
30+
[OutputType('Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Models.EligibleAuthorization')]
2931
[CmdletBinding(PositionalBinding=$false)]
3032
Param(
3133

3234
[Parameter(HelpMessage="The list of managedByTenant approvers for the eligible authorization.")]
33-
[Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Models.Api20200201Preview.IEligibleApprover[]]
35+
[Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Models.IEligibleApprover[]]
3436
$JustInTimeAccessPolicyManagedByTenantApprover,
3537
[Parameter(HelpMessage="The maximum access duration in ISO 8601 format for just-in-time access requests.")]
3638
[System.TimeSpan]
3739
$JustInTimeAccessPolicyMaximumActivationDuration,
3840
[Parameter(HelpMessage="The multi-factor authorization provider to be used for just-in-time access requests.")]
39-
[Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Support.MultiFactorAuthProvider]
40-
[ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Support.MultiFactorAuthProvider])]
41+
[Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.PSArgumentCompleterAttribute("Azure", "None")]
42+
[string]
4143
$JustInTimeAccessPolicyMultiFactorAuthProvider,
4244
[Parameter(Mandatory, HelpMessage="The identifier of the Azure Active Directory principal.")]
4345
[string]
@@ -51,7 +53,7 @@
5153
)
5254

5355
process {
54-
$Object = [Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Models.Api20200201Preview.EligibleAuthorization]::New()
56+
$Object = [Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Models.EligibleAuthorization]::New()
5557

5658
$Object.JustInTimeAccessPolicyManagedByTenantApprover = $JustInTimeAccessPolicyManagedByTenantApprover
5759

src/ManagedServices/ManagedServices.Autorest/custom/autogen-model-cmdlets/New-AzManagedServicesAuthorizationObject.ps1

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,13 @@ Create an in-memory object for Authorization.
2121
Create an in-memory object for Authorization.
2222
2323
.Outputs
24-
Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Models.Api20200201Preview.Authorization
24+
Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Models.Authorization
2525
.Link
26-
https://learn.microsoft.com/powershell/module/Az.ManagedServices/new-AzManagedServicesAuthorizationObject
26+
https://learn.microsoft.com/powershell/module/Az.ManagedServices/new-azmanagedservicesauthorizationobject
2727
#>
2828
function New-AzManagedServicesAuthorizationObject {
29-
[OutputType('Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Models.Api20200201Preview.Authorization')]
29+
[Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.ModelCmdletAttribute()]
30+
[OutputType('Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Models.Authorization')]
3031
[CmdletBinding(PositionalBinding=$false)]
3132
Param(
3233

@@ -45,7 +46,7 @@ function New-AzManagedServicesAuthorizationObject {
4546
)
4647

4748
process {
48-
$Object = [Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Models.Api20200201Preview.Authorization]::New()
49+
$Object = [Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Models.Authorization]::New()
4950

5051
if ($PSBoundParameters.ContainsKey('DelegatedRoleDefinitionId')) {
5152
$Object.DelegatedRoleDefinitionId = $DelegatedRoleDefinitionId

src/ManagedServices/ManagedServices.Autorest/custom/autogen-model-cmdlets/New-AzManagedServicesEligibleApproverObject.ps1

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,13 @@ Create an in-memory object for EligibleApprover.
2121
Create an in-memory object for EligibleApprover.
2222
2323
.Outputs
24-
Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Models.Api20200201Preview.EligibleApprover
24+
Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Models.EligibleApprover
2525
.Link
26-
https://learn.microsoft.com/powershell/module/Az.ManagedServices/new-AzManagedServicesEligibleApproverObject
26+
https://learn.microsoft.com/powershell/module/Az.ManagedServices/new-azmanagedserviceseligibleapproverobject
2727
#>
2828
function New-AzManagedServicesEligibleApproverObject {
29-
[OutputType('Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Models.Api20200201Preview.EligibleApprover')]
29+
[Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.ModelCmdletAttribute()]
30+
[OutputType('Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Models.EligibleApprover')]
3031
[CmdletBinding(PositionalBinding=$false)]
3132
Param(
3233

@@ -39,7 +40,7 @@ function New-AzManagedServicesEligibleApproverObject {
3940
)
4041

4142
process {
42-
$Object = [Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Models.Api20200201Preview.EligibleApprover]::New()
43+
$Object = [Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Models.EligibleApprover]::New()
4344

4445
if ($PSBoundParameters.ContainsKey('PrincipalId')) {
4546
$Object.PrincipalId = $PrincipalId

src/ManagedServices/ManagedServices.Autorest/docs/Az.ManagedServices.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
Module Name: Az.ManagedServices
3-
Module Guid: f3c1cabd-ba4d-4158-b4f3-9e037b7a2d62
3+
Module Guid: 54366ec5-1955-4a40-b1df-da4057a89b87
44
Download Help Link: https://learn.microsoft.com/powershell/module/az.managedservices
55
Help Version: 1.0.0.0
66
Locale: en-US
@@ -21,23 +21,26 @@ Gets the registration definition details.
2121
Get the marketplace registration definition for the marketplace identifier.
2222

2323
### [New-AzManagedServicesAssignment](New-AzManagedServicesAssignment.md)
24-
Creates or updates a registration assignment.
24+
Create a registration assignment.
2525

2626
### [New-AzManagedServicesAuthorizationObject](New-AzManagedServicesAuthorizationObject.md)
2727
Create an in-memory object for Authorization.
2828

2929
### [New-AzManagedServicesDefinition](New-AzManagedServicesDefinition.md)
30-
Creates or updates a registration definition.
30+
Create a registration definition.
3131

3232
### [New-AzManagedServicesEligibleApproverObject](New-AzManagedServicesEligibleApproverObject.md)
3333
Create an in-memory object for EligibleApprover.
3434

3535
### [New-AzManagedServicesEligibleAuthorizationObject](New-AzManagedServicesEligibleAuthorizationObject.md)
36-
Create a in-memory object for EligibleAuthorization
36+
Create an in-memory object for EligibleAuthorization.
3737

3838
### [Remove-AzManagedServicesAssignment](Remove-AzManagedServicesAssignment.md)
3939
Deletes the specified registration assignment.
4040

4141
### [Remove-AzManagedServicesDefinition](Remove-AzManagedServicesDefinition.md)
4242
Deletes the registration definition.
4343

44+
### [Update-AzManagedServicesDefinition](Update-AzManagedServicesDefinition.md)
45+
Update a registration definition.
46+

src/ManagedServices/ManagedServices.Autorest/docs/Get-AzManagedServicesAssignment.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,6 @@ Accept wildcard characters: False
127127
128128
### -InputObject
129129
Identity Parameter
130-
To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
131130
132131
```yaml
133132
Type: Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Models.IManagedServicesIdentity
@@ -180,7 +179,7 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
180179
181180
## OUTPUTS
182181
183-
### Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Models.Api20200201Preview.IRegistrationAssignment
182+
### Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Models.IRegistrationAssignment
184183
185184
## NOTES
186185

src/ManagedServices/ManagedServices.Autorest/docs/Get-AzManagedServicesDefinition.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,6 @@ Accept wildcard characters: False
107107
108108
### -InputObject
109109
Identity Parameter
110-
To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
111110
112111
```yaml
113112
Type: Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Models.IManagedServicesIdentity
@@ -160,7 +159,7 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
160159
161160
## OUTPUTS
162161
163-
### Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Models.Api20200201Preview.IRegistrationDefinition
162+
### Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Models.IRegistrationDefinition
164163
165164
## NOTES
166165

src/ManagedServices/ManagedServices.Autorest/docs/Get-AzManagedServicesMarketplaceDefinition.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
165165
166166
## OUTPUTS
167167
168-
### Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Models.Api20200201Preview.IMarketplaceRegistrationDefinition
168+
### Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Models.IMarketplaceRegistrationDefinition
169169
170170
## NOTES
171171

0 commit comments

Comments
 (0)