Skip to content

Commit a1cce68

Browse files
authored
[Az.Purview] Update generation tool version: autorest.powershell v3->v4 (#27871)
1 parent f5d8429 commit a1cce68

38 files changed

+844
-268
lines changed
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
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 - Purview")]
23+
[assembly: System.Reflection.AssemblyFileVersionAttribute("0.2.2")]
24+
[assembly: System.Reflection.AssemblyVersionAttribute("0.2.2")]
25+
[assembly: System.Runtime.InteropServices.ComVisibleAttribute(false)]
26+
[assembly: System.CLSCompliantAttribute(false)]

src/Purview/Purview.Autorest/README.md

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,20 +37,16 @@ input-file:
3737
module-version: 0.1.0
3838
title: Purview
3939
subject-prefix: $(service-name)
40-
identity-correction-for-post: true
41-
nested-object-to-string: true
42-
resourcegroup-append: true
43-
44-
# For new modules, please avoid setting 3.x using the use-extension method and instead, use 4.x as the default option
45-
use-extension:
46-
"@autorest/powershell": "3.x"
4740

4841
directive:
4942
# Following is two common directive which are normally required in all the RPs
5043
# 1. Remove the unexpanded parameter set
5144
# 2. For New-* cmdlets, ViaIdentity is not required, so CreateViaIdentityExpanded is removed as well
5245
- where:
53-
variant: ^Create$|^CreateViaIdentity$|^CreateViaIdentityExpanded$|^Update$|^UpdateViaIdentity$|^Check$|^CheckViaIdentity$|^CheckViaIdentityExpanded$|^Set$|^AddViaIdentity$|^Add$
46+
variant: ^(Create|Update|Check|Add|Set)(?!.*?(Expanded|JsonFilePath|JsonString))
47+
remove: true
48+
- where:
49+
variant: ^CreateViaIdentity$|^CreateViaIdentityExpanded$|^CheckViaIdentityExpanded$
5450
remove: true
5551
# Remove the set-* cmdlet
5652
- where:

src/Purview/Purview.Autorest/custom/Add-AzPurviewAccountRootCollectionAdmin.ps1

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,18 +51,24 @@ function Add-AzPurviewAccountRootCollectionAdmin {
5151
[CmdletBinding(DefaultParameterSetName='AddExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
5252
param(
5353
[Parameter(ParameterSetName='AddExpanded', Mandatory)]
54+
[Parameter(ParameterSetName='AddViaJsonFilePath', Mandatory)]
55+
[Parameter(ParameterSetName='AddViaJsonString', Mandatory)]
5456
[Microsoft.Azure.PowerShell.Cmdlets.Purview.Category('Path')]
5557
[System.String]
5658
# The name of the account.
5759
${AccountName},
5860

5961
[Parameter(ParameterSetName='AddExpanded', Mandatory)]
62+
[Parameter(ParameterSetName='AddViaJsonFilePath', Mandatory)]
63+
[Parameter(ParameterSetName='AddViaJsonString', Mandatory)]
6064
[Microsoft.Azure.PowerShell.Cmdlets.Purview.Category('Path')]
6165
[System.String]
6266
# The resource group name.
6367
${ResourceGroupName},
6468

6569
[Parameter(ParameterSetName='AddExpanded')]
70+
[Parameter(ParameterSetName='AddViaJsonFilePath')]
71+
[Parameter(ParameterSetName='AddViaJsonString')]
6672
[Microsoft.Azure.PowerShell.Cmdlets.Purview.Category('Path')]
6773
[Microsoft.Azure.PowerShell.Cmdlets.Purview.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')]
6874
[System.String]
@@ -73,21 +79,34 @@ param(
7379
[Microsoft.Azure.PowerShell.Cmdlets.Purview.Category('Path')]
7480
[Microsoft.Azure.PowerShell.Cmdlets.Purview.Models.IPurviewIdentity]
7581
# Identity Parameter
76-
# To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
7782
${InputObject},
7883

79-
[Parameter(Mandatory)]
84+
[Parameter(ParameterSetName='AddExpanded', Mandatory)]
85+
[Parameter(ParameterSetName='AddViaIdentityExpanded', Mandatory)]
8086
[Microsoft.Azure.PowerShell.Cmdlets.Purview.Category('Body')]
8187
[System.String]
8288
# Gets or sets the object identifier of the admin.
8389
${ObjectId},
8490

91+
[Parameter(ParameterSetName='AddViaJsonFilePath', Mandatory)]
92+
[Microsoft.Azure.PowerShell.Cmdlets.Purview.Category('Body')]
93+
[System.String]
94+
# Path of Json file supplied to the Add operation
95+
${JsonFilePath},
96+
97+
[Parameter(ParameterSetName='AddViaJsonString', Mandatory)]
98+
[Microsoft.Azure.PowerShell.Cmdlets.Purview.Category('Body')]
99+
[System.String]
100+
# Json string supplied to the Add operation
101+
${JsonString},
102+
85103
[Parameter()]
86104
[Alias('AzureRMContext', 'AzureCredential')]
87105
[ValidateNotNull()]
88106
[Microsoft.Azure.PowerShell.Cmdlets.Purview.Category('Azure')]
89107
[System.Management.Automation.PSObject]
90-
# The credentials, account, tenant, and subscription used for communication with Azure.
108+
# The DefaultProfile parameter is not functional.
109+
# Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.
91110
${DefaultProfile},
92111

93112
[Parameter(DontShow)]

src/Purview/Purview.Autorest/custom/New-AzPurviewAccount.ps1

Lines changed: 49 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,12 @@ PS C:\> {{ Add code here }}
2828
{{ Add output here }}
2929
3030
.Outputs
31-
Microsoft.Azure.PowerShell.Cmdlets.Purview.Models.Api20210701.IAccount
31+
Microsoft.Azure.PowerShell.Cmdlets.Purview.Models.IAccount
3232
.Link
3333
https://learn.microsoft.com/powershell/module/az.purview/new-azpurviewaccount
3434
#>
3535
function New-AzPurviewAccount {
36-
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Purview.Models.Api20210701.IAccount])]
36+
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Purview.Models.IAccount])]
3737
[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
3838
param(
3939
[Parameter(Mandatory)]
@@ -42,120 +42,132 @@ function New-AzPurviewAccount {
4242
[System.String]
4343
# The name of the account.
4444
${Name},
45-
45+
4646
[Parameter(Mandatory)]
4747
[Microsoft.Azure.PowerShell.Cmdlets.Purview.Category('Path')]
4848
[System.String]
4949
# The resource group name.
5050
${ResourceGroupName},
51-
51+
5252
[Parameter()]
5353
[Microsoft.Azure.PowerShell.Cmdlets.Purview.Category('Path')]
5454
[Microsoft.Azure.PowerShell.Cmdlets.Purview.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')]
5555
[System.String]
5656
# The subscription identifier
5757
${SubscriptionId},
58-
59-
[Parameter(Mandatory)]
60-
[ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Purview.Support.Type])]
58+
59+
[Parameter(ParameterSetName='CreateExpanded', Mandatory)]
6160
[Microsoft.Azure.PowerShell.Cmdlets.Purview.Category('Body')]
62-
[Microsoft.Azure.PowerShell.Cmdlets.Purview.Support.Type]
63-
# Identity Type
64-
${IdentityType},
65-
66-
[Parameter(Mandatory)]
61+
[System.Management.Automation.SwitchParameter]
62+
# Determines whether to enable a system-assigned identity for the resource.
63+
${EnableSystemAssignedIdentity},
64+
65+
[Parameter(ParameterSetName='CreateExpanded', Mandatory)]
6766
[Microsoft.Azure.PowerShell.Cmdlets.Purview.Category('Body')]
6867
[System.String]
6968
# Gets or sets the location.
7069
${Location},
71-
72-
[Parameter()]
70+
71+
[Parameter(ParameterSetName='CreateExpanded')]
7372
[Microsoft.Azure.PowerShell.Cmdlets.Purview.Category('Body')]
7473
[System.String]
7574
# Gets or sets the managed resource group name
7675
${ManagedResourceGroupName},
77-
78-
[Parameter()]
79-
[ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Purview.Support.PublicNetworkAccess])]
76+
77+
[Parameter(ParameterSetName='CreateExpanded')]
78+
[Microsoft.Azure.PowerShell.Cmdlets.Purview.PSArgumentCompleterAttribute("NotSpecified", "Enabled", "Disabled")]
8079
[Microsoft.Azure.PowerShell.Cmdlets.Purview.Category('Body')]
81-
[Microsoft.Azure.PowerShell.Cmdlets.Purview.Support.PublicNetworkAccess]
80+
[System.String]
8281
# Gets or sets the public network access.
8382
${PublicNetworkAccess},
84-
85-
[Parameter(Mandatory)]
83+
84+
[Parameter(ParameterSetName='CreateExpanded', Mandatory)]
8685
[Microsoft.Azure.PowerShell.Cmdlets.Purview.Category('Body')]
8786
[System.Int32]
8887
# Gets or sets the sku capacity.
8988
# Possible values include: 4, 16
9089
${SkuCapacity},
91-
92-
[Parameter(Mandatory)]
93-
[ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Purview.Support.Name])]
90+
91+
[Parameter(ParameterSetName='CreateExpanded', Mandatory)]
92+
[Microsoft.Azure.PowerShell.Cmdlets.Purview.PSArgumentCompleterAttribute("Standard")]
9493
[Microsoft.Azure.PowerShell.Cmdlets.Purview.Category('Body')]
95-
[Microsoft.Azure.PowerShell.Cmdlets.Purview.Support.Name]
94+
[System.String]
9695
# Gets or sets the sku name.
9796
${SkuName},
98-
99-
[Parameter()]
97+
98+
[Parameter(ParameterSetName='CreateExpanded')]
10099
[Microsoft.Azure.PowerShell.Cmdlets.Purview.Category('Body')]
101-
[Microsoft.Azure.PowerShell.Cmdlets.Purview.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Purview.Models.Api20210701.ITrackedResourceTags]))]
100+
[Microsoft.Azure.PowerShell.Cmdlets.Purview.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Purview.Models.ITrackedResourceTags]))]
102101
[System.Collections.Hashtable]
103102
# Tags on the azure resource.
104103
${Tag},
105-
104+
105+
[Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)]
106+
[Microsoft.Azure.PowerShell.Cmdlets.Purview.Category('Body')]
107+
[System.String]
108+
# Path of Json file supplied to the Create operation
109+
${JsonFilePath},
110+
111+
[Parameter(ParameterSetName='CreateViaJsonString', Mandatory)]
112+
[Microsoft.Azure.PowerShell.Cmdlets.Purview.Category('Body')]
113+
[System.String]
114+
# Json string supplied to the Create operation
115+
${JsonString},
116+
106117
[Parameter()]
107118
[Alias('AzureRMContext', 'AzureCredential')]
108119
[ValidateNotNull()]
109120
[Microsoft.Azure.PowerShell.Cmdlets.Purview.Category('Azure')]
110121
[System.Management.Automation.PSObject]
111-
# The credentials, account, tenant, and subscription used for communication with Azure.
122+
# The DefaultProfile parameter is not functional.
123+
# Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.
112124
${DefaultProfile},
113-
125+
114126
[Parameter()]
115127
[Microsoft.Azure.PowerShell.Cmdlets.Purview.Category('Runtime')]
116128
[System.Management.Automation.SwitchParameter]
117129
# Run the command as a job
118130
${AsJob},
119-
131+
120132
[Parameter(DontShow)]
121133
[Microsoft.Azure.PowerShell.Cmdlets.Purview.Category('Runtime')]
122134
[System.Management.Automation.SwitchParameter]
123135
# Wait for .NET debugger to attach
124136
${Break},
125-
137+
126138
[Parameter(DontShow)]
127139
[ValidateNotNull()]
128140
[Microsoft.Azure.PowerShell.Cmdlets.Purview.Category('Runtime')]
129141
[Microsoft.Azure.PowerShell.Cmdlets.Purview.Runtime.SendAsyncStep[]]
130142
# SendAsync Pipeline Steps to be appended to the front of the pipeline
131143
${HttpPipelineAppend},
132-
144+
133145
[Parameter(DontShow)]
134146
[ValidateNotNull()]
135147
[Microsoft.Azure.PowerShell.Cmdlets.Purview.Category('Runtime')]
136148
[Microsoft.Azure.PowerShell.Cmdlets.Purview.Runtime.SendAsyncStep[]]
137149
# SendAsync Pipeline Steps to be prepended to the front of the pipeline
138150
${HttpPipelinePrepend},
139-
151+
140152
[Parameter()]
141153
[Microsoft.Azure.PowerShell.Cmdlets.Purview.Category('Runtime')]
142154
[System.Management.Automation.SwitchParameter]
143155
# Run the command asynchronously
144156
${NoWait},
145-
157+
146158
[Parameter(DontShow)]
147159
[Microsoft.Azure.PowerShell.Cmdlets.Purview.Category('Runtime')]
148160
[System.Uri]
149161
# The URI for the proxy server to use
150162
${Proxy},
151-
163+
152164
[Parameter(DontShow)]
153165
[ValidateNotNull()]
154166
[Microsoft.Azure.PowerShell.Cmdlets.Purview.Category('Runtime')]
155167
[System.Management.Automation.PSCredential]
156168
# Credentials for a proxy server to use for the remote call
157169
${ProxyCredential},
158-
170+
159171
[Parameter(DontShow)]
160172
[Microsoft.Azure.PowerShell.Cmdlets.Purview.Category('Runtime')]
161173
[System.Management.Automation.SwitchParameter]

src/Purview/Purview.Autorest/custom/Set-AzPurviewDefaultAccount.ps1

Lines changed: 24 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -28,59 +28,72 @@ PS C:\> {{ Add code here }}
2828
{{ Add output here }}
2929
3030
.Outputs
31-
Microsoft.Azure.PowerShell.Cmdlets.Purview.Models.Api20210701.IDefaultAccountPayload
31+
Microsoft.Azure.PowerShell.Cmdlets.Purview.Models.IDefaultAccountPayload
3232
.Link
3333
https://learn.microsoft.com/powershell/module/az.purview/set-azpurviewdefaultaccount
3434
#>
3535
function Set-AzPurviewDefaultAccount {
36-
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Purview.Models.Api20210701.IDefaultAccountPayload])]
36+
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Purview.Models.IDefaultAccountPayload])]
3737
[CmdletBinding(DefaultParameterSetName='SetExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
3838
param(
39-
[Parameter(Mandatory)]
39+
[Parameter(ParameterSetName='SetExpanded', Mandatory)]
4040
[Microsoft.Azure.PowerShell.Cmdlets.Purview.Category('Body')]
4141
[System.String]
4242
# The name of the account that is set as the default.
4343
${AccountName},
4444

45-
[Parameter(Mandatory)]
45+
[Parameter(ParameterSetName='SetExpanded', Mandatory)]
4646
[Microsoft.Azure.PowerShell.Cmdlets.Purview.Category('Body')]
4747
[System.String]
4848
# The resource group name of the account that is set as the default.
4949
${ResourceGroupName},
5050

51-
[Parameter()]
51+
[Parameter(ParameterSetName='SetExpanded')]
5252
[Microsoft.Azure.PowerShell.Cmdlets.Purview.Category('Body')]
5353
[System.String]
5454
# The scope object ID.
5555
# For example, sub ID or tenant ID.
5656
${Scope},
5757

58-
[Parameter(Mandatory)]
58+
[Parameter(ParameterSetName='SetExpanded', Mandatory)]
5959
[Microsoft.Azure.PowerShell.Cmdlets.Purview.Category('Body')]
6060
[System.String]
6161
# The scope tenant in which the default account is set.
6262
${ScopeTenantId},
6363

64-
[Parameter()]
65-
[ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Purview.Support.ScopeType])]
64+
[Parameter(ParameterSetName='SetExpanded')]
65+
[Microsoft.Azure.PowerShell.Cmdlets.Purview.PSArgumentCompleterAttribute("Tenant", "Subscription")]
6666
[Microsoft.Azure.PowerShell.Cmdlets.Purview.Category('Body')]
67-
[Microsoft.Azure.PowerShell.Cmdlets.Purview.Support.ScopeType]
67+
[System.String]
6868
# The scope where the default account is set.
6969
${ScopeType},
7070

71-
[Parameter()]
71+
[Parameter(ParameterSetName='SetExpanded')]
7272
[Microsoft.Azure.PowerShell.Cmdlets.Purview.Category('Body')]
7373
[Microsoft.Azure.PowerShell.Cmdlets.Purview.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')]
7474
[System.String]
7575
# The subscription ID of the account that is set as the default.
7676
${SubscriptionId},
7777

78+
[Parameter(ParameterSetName='SetViaJsonFilePath', Mandatory)]
79+
[Microsoft.Azure.PowerShell.Cmdlets.Purview.Category('Body')]
80+
[System.String]
81+
# Path of Json file supplied to the Set operation
82+
${JsonFilePath},
83+
84+
[Parameter(ParameterSetName='SetViaJsonString', Mandatory)]
85+
[Microsoft.Azure.PowerShell.Cmdlets.Purview.Category('Body')]
86+
[System.String]
87+
# Json string supplied to the Set operation
88+
${JsonString},
89+
7890
[Parameter()]
7991
[Alias('AzureRMContext', 'AzureCredential')]
8092
[ValidateNotNull()]
8193
[Microsoft.Azure.PowerShell.Cmdlets.Purview.Category('Azure')]
8294
[System.Management.Automation.PSObject]
83-
# The credentials, account, tenant, and subscription used for communication with Azure.
95+
# The DefaultProfile parameter is not functional.
96+
# Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.
8497
${DefaultProfile},
8598

8699
[Parameter(DontShow)]

0 commit comments

Comments
 (0)