Skip to content

Commit c926eab

Browse files
authored
migrate Portal module to autorest v4 (Azure#27288)
1 parent 6fa2807 commit c926eab

21 files changed

+343
-80
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 - Portal")]
23+
[assembly: System.Reflection.AssemblyFileVersionAttribute("0.3.0")]
24+
[assembly: System.Reflection.AssemblyVersionAttribute("0.3.0")]
25+
[assembly: System.Runtime.InteropServices.ComVisibleAttribute(false)]
26+
[assembly: System.CLSCompliantAttribute(false)]

src/Portal/Portal.Autorest/README.md

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,6 @@ module-version: 0.1.0
5454
title: Portal
5555
subject-prefix: $(service-name)
5656

57-
# For new modules, please avoid setting 3.x using the use-extension method and instead, use 4.x as the default option
58-
use-extension:
59-
"@autorest/powershell": "3.x"
60-
6157
directive:
6258
- where:
6359
verb: Set
@@ -66,12 +62,12 @@ directive:
6662
- where:
6763
verb: New
6864
subject: Dashboard
69-
variant: CreateViaIdentity|CreateViaIdentityExpanded
65+
variant: ^CreateViaIdentity$|^CreateViaIdentityExpanded$
7066
remove: true
7167
- where:
7268
verb: Update
7369
subject: Dashboard
74-
variant: ^Update$|^UpdateViaIdentity$
70+
variant: ^(Create|Update)(?!.*?(Expanded|JsonFilePath|JsonString))
7571
remove: true
7672
- from: swagger-document
7773
where: $.definitions.DashboardPropertiesWithProvisioningState.properties.metadata

src/Portal/Portal.Autorest/custom/New-AzPortalDashboard.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616

1717
function New-AzPortalDashboard {
18-
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Portal.Models.Api20221201Preview.IDashboard])]
18+
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Portal.Models.IDashboard])]
1919
[CmdletBinding(SupportsShouldProcess, ConfirmImpact='Medium')]
2020
param(
2121
[Parameter(ParameterSetName='CreateByFile', Mandatory)]
@@ -112,7 +112,7 @@ begin {
112112
if (Test-Path $dashboardPath)
113113
{
114114
$content = (Get-content -Path $dashboardPath)
115-
$deserializedContent = [Microsoft.Azure.PowerShell.Cmdlets.Portal.Models.Api20221201Preview.Dashboard]::FromJsonString($content)
115+
$deserializedContent = [Microsoft.Azure.PowerShell.Cmdlets.Portal.Models.Dashboard]::FromJsonString($content)
116116
$PSBoundParameters.Remove('DashboardPath') | Out-Null
117117
$PSBoundParameters.Add('Resource', $deserializedContent) | Out-Null
118118
$scriptCmd = {& $wrappedCmd @PSBoundParameters}

src/Portal/Portal.Autorest/custom/Set-AzPortalDashboard.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616

1717
function Set-AzPortalDashboard {
18-
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Portal.Models.Api20221201Preview.IDashboard])]
18+
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Portal.Models.IDashboard])]
1919
[CmdletBinding(SupportsShouldProcess, PositionalBinding=$false, ConfirmImpact='Medium')]
2020
[Microsoft.Azure.PowerShell.Cmdlets.Portal.Description("Creates or updates a Dashboard.")]
2121
param(
@@ -112,7 +112,7 @@ begin {
112112
if (Test-Path $dashboardPath)
113113
{
114114
$content = (Get-content -Path $dashboardPath)
115-
$deserializedContent = [Microsoft.Azure.PowerShell.Cmdlets.Portal.Models.Api20221201Preview.Dashboard]::FromJsonString($content)
115+
$deserializedContent = [Microsoft.Azure.PowerShell.Cmdlets.Portal.Models.Dashboard]::FromJsonString($content)
116116
$PSBoundParameters.Remove('DashboardPath') | Out-Null
117117
$PSBoundParameters.Add('Resource', $deserializedContent) | Out-Null
118118
$scriptCmd = {& $wrappedCmd @PSBoundParameters}

src/Portal/Portal.Autorest/docs/Az.Portal.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
Module Name: Az.Portal
3-
Module Guid: abd8c13e-6209-4e5a-a276-61e7a80845f9
3+
Module Guid: 31aca27a-d75c-4e24-9a57-ed8c410db168
44
Download Help Link: https://learn.microsoft.com/powershell/module/az.portal
55
Help Version: 1.0.0.0
66
Locale: en-US
@@ -15,7 +15,7 @@ Microsoft Azure PowerShell: Portal Dashboard cmdlets
1515
Gets the Dashboard.
1616

1717
### [New-AzPortalDashboard](New-AzPortalDashboard.md)
18-
Creates or updates a Dashboard.
18+
create a Dashboard.
1919

2020
### [Remove-AzPortalDashboard](Remove-AzPortalDashboard.md)
2121
Deletes the Dashboard.
@@ -24,5 +24,5 @@ Deletes the Dashboard.
2424
Creates or updates a Dashboard.
2525

2626
### [Update-AzPortalDashboard](Update-AzPortalDashboard.md)
27-
Updates an existing Dashboard.
27+
update an existing Dashboard.
2828

src/Portal/Portal.Autorest/docs/Get-AzPortalDashboard.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,6 @@ Accept wildcard characters: False
8686
8787
### -InputObject
8888
Identity Parameter
89-
To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
9089
9190
```yaml
9291
Type: Microsoft.Azure.PowerShell.Cmdlets.Portal.Models.IPortalIdentity
@@ -156,7 +155,7 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
156155
157156
## OUTPUTS
158157
159-
### Microsoft.Azure.PowerShell.Cmdlets.Portal.Models.Api20221201Preview.IDashboard
158+
### Microsoft.Azure.PowerShell.Cmdlets.Portal.Models.IDashboard
160159
161160
## NOTES
162161

src/Portal/Portal.Autorest/docs/New-AzPortalDashboard.md

Lines changed: 48 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ schema: 2.0.0
88
# New-AzPortalDashboard
99

1010
## SYNOPSIS
11-
Creates or updates a Dashboard.
11+
create a Dashboard.
1212

1313
## SYNTAX
1414

@@ -31,8 +31,20 @@ New-AzPortalDashboard -Name <String> -ResourceGroupName <String> -DashboardPath
3131
[-SubscriptionId <String>] [-DefaultProfile <PSObject>] [-Confirm] [-WhatIf] [<CommonParameters>]
3232
```
3333

34+
### CreateViaJsonFilePath
35+
```
36+
New-AzPortalDashboard -Name <String> -ResourceGroupName <String> -JsonFilePath <String>
37+
[-SubscriptionId <String>] [-DefaultProfile <PSObject>] [-Confirm] [-WhatIf] [<CommonParameters>]
38+
```
39+
40+
### CreateViaJsonString
41+
```
42+
New-AzPortalDashboard -Name <String> -ResourceGroupName <String> -JsonString <String>
43+
[-SubscriptionId <String>] [-DefaultProfile <PSObject>] [-Confirm] [-WhatIf] [<CommonParameters>]
44+
```
45+
3446
## DESCRIPTION
35-
Creates or updates a Dashboard.
47+
create a Dashboard.
3648

3749
## EXAMPLES
3850

@@ -83,12 +95,41 @@ Accept pipeline input: False
8395
Accept wildcard characters: False
8496
```
8597
98+
### -JsonFilePath
99+
Path of Json file supplied to the Create operation
100+
101+
```yaml
102+
Type: System.String
103+
Parameter Sets: CreateViaJsonFilePath
104+
Aliases:
105+
106+
Required: True
107+
Position: Named
108+
Default value: None
109+
Accept pipeline input: False
110+
Accept wildcard characters: False
111+
```
112+
113+
### -JsonString
114+
Json string supplied to the Create operation
115+
116+
```yaml
117+
Type: System.String
118+
Parameter Sets: CreateViaJsonString
119+
Aliases:
120+
121+
Required: True
122+
Position: Named
123+
Default value: None
124+
Accept pipeline input: False
125+
Accept wildcard characters: False
126+
```
127+
86128
### -Lens
87129
The dashboard lenses.
88-
To construct, see NOTES section for LENS properties and create a hash table.
89130
90131
```yaml
91-
Type: Microsoft.Azure.PowerShell.Cmdlets.Portal.Models.Api20221201Preview.IDashboardLens[]
132+
Type: Microsoft.Azure.PowerShell.Cmdlets.Portal.Models.IDashboardLens[]
92133
Parameter Sets: CreateExpanded
93134
Aliases:
94135

@@ -146,10 +187,9 @@ Accept wildcard characters: False
146187
147188
### -Resource
148189
The shared dashboard resource definition.
149-
To construct, see NOTES section for RESOURCE properties and create a hash table.
150190
151191
```yaml
152-
Type: Microsoft.Azure.PowerShell.Cmdlets.Portal.Models.Api20221201Preview.IDashboard
192+
Type: Microsoft.Azure.PowerShell.Cmdlets.Portal.Models.IDashboard
153193
Parameter Sets: Create
154194
Aliases:
155195

@@ -243,11 +283,11 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
243283
244284
## INPUTS
245285
246-
### Microsoft.Azure.PowerShell.Cmdlets.Portal.Models.Api20221201Preview.IDashboard
286+
### Microsoft.Azure.PowerShell.Cmdlets.Portal.Models.IDashboard
247287
248288
## OUTPUTS
249289
250-
### Microsoft.Azure.PowerShell.Cmdlets.Portal.Models.Api20221201Preview.IDashboard
290+
### Microsoft.Azure.PowerShell.Cmdlets.Portal.Models.IDashboard
251291
252292
## NOTES
253293

src/Portal/Portal.Autorest/docs/Remove-AzPortalDashboard.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ Accept wildcard characters: False
6363
6464
### -InputObject
6565
Identity Parameter
66-
To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
6766
6867
```yaml
6968
Type: Microsoft.Azure.PowerShell.Cmdlets.Portal.Models.IPortalIdentity

src/Portal/Portal.Autorest/docs/Set-AzPortalDashboard.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
151151
152152
## OUTPUTS
153153
154-
### Microsoft.Azure.PowerShell.Cmdlets.Portal.Models.Api20221201Preview.IDashboard
154+
### Microsoft.Azure.PowerShell.Cmdlets.Portal.Models.IDashboard
155155
156156
## NOTES
157157

src/Portal/Portal.Autorest/docs/Update-AzPortalDashboard.md

Lines changed: 52 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ schema: 2.0.0
88
# Update-AzPortalDashboard
99

1010
## SYNOPSIS
11-
Updates an existing Dashboard.
11+
update an existing Dashboard.
1212

1313
## SYNTAX
1414

@@ -25,8 +25,20 @@ Update-AzPortalDashboard -InputObject <IPortalIdentity> [-Lens <IDashboardLens[]
2525
[-Tag <Hashtable>] [-DefaultProfile <PSObject>] [-Confirm] [-WhatIf] [<CommonParameters>]
2626
```
2727

28+
### UpdateViaJsonFilePath
29+
```
30+
Update-AzPortalDashboard -Name <String> -ResourceGroupName <String> -JsonFilePath <String>
31+
[-SubscriptionId <String>] [-DefaultProfile <PSObject>] [-Confirm] [-WhatIf] [<CommonParameters>]
32+
```
33+
34+
### UpdateViaJsonString
35+
```
36+
Update-AzPortalDashboard -Name <String> -ResourceGroupName <String> -JsonString <String>
37+
[-SubscriptionId <String>] [-DefaultProfile <PSObject>] [-Confirm] [-WhatIf] [<CommonParameters>]
38+
```
39+
2840
## DESCRIPTION
29-
Updates an existing Dashboard.
41+
update an existing Dashboard.
3042

3143
## EXAMPLES
3244

@@ -78,7 +90,6 @@ Accept wildcard characters: False
7890
7991
### -InputObject
8092
Identity Parameter
81-
To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
8293
8394
```yaml
8495
Type: Microsoft.Azure.PowerShell.Cmdlets.Portal.Models.IPortalIdentity
@@ -92,13 +103,42 @@ Accept pipeline input: True (ByValue)
92103
Accept wildcard characters: False
93104
```
94105
106+
### -JsonFilePath
107+
Path of Json file supplied to the Update operation
108+
109+
```yaml
110+
Type: System.String
111+
Parameter Sets: UpdateViaJsonFilePath
112+
Aliases:
113+
114+
Required: True
115+
Position: Named
116+
Default value: None
117+
Accept pipeline input: False
118+
Accept wildcard characters: False
119+
```
120+
121+
### -JsonString
122+
Json string supplied to the Update operation
123+
124+
```yaml
125+
Type: System.String
126+
Parameter Sets: UpdateViaJsonString
127+
Aliases:
128+
129+
Required: True
130+
Position: Named
131+
Default value: None
132+
Accept pipeline input: False
133+
Accept wildcard characters: False
134+
```
135+
95136
### -Lens
96137
The dashboard lenses.
97-
To construct, see NOTES section for LENS properties and create a hash table.
98138
99139
```yaml
100-
Type: Microsoft.Azure.PowerShell.Cmdlets.Portal.Models.Api20221201Preview.IDashboardLens[]
101-
Parameter Sets: (All)
140+
Type: Microsoft.Azure.PowerShell.Cmdlets.Portal.Models.IDashboardLens[]
141+
Parameter Sets: UpdateExpanded, UpdateViaIdentityExpanded
102142
Aliases:
103143

104144
Required: False
@@ -113,7 +153,7 @@ The dashboard metadata.
113153
114154
```yaml
115155
Type: System.Collections.Hashtable
116-
Parameter Sets: (All)
156+
Parameter Sets: UpdateExpanded, UpdateViaIdentityExpanded
117157
Aliases:
118158

119159
Required: False
@@ -128,7 +168,7 @@ The name of the dashboard.
128168
129169
```yaml
130170
Type: System.String
131-
Parameter Sets: UpdateExpanded
171+
Parameter Sets: UpdateExpanded, UpdateViaJsonFilePath, UpdateViaJsonString
132172
Aliases: DashboardName
133173

134174
Required: True
@@ -144,7 +184,7 @@ The name is case insensitive.
144184
145185
```yaml
146186
Type: System.String
147-
Parameter Sets: UpdateExpanded
187+
Parameter Sets: UpdateExpanded, UpdateViaJsonFilePath, UpdateViaJsonString
148188
Aliases:
149189

150190
Required: True
@@ -160,7 +200,7 @@ The value must be an UUID.
160200
161201
```yaml
162202
Type: System.String
163-
Parameter Sets: UpdateExpanded
203+
Parameter Sets: UpdateExpanded, UpdateViaJsonFilePath, UpdateViaJsonString
164204
Aliases:
165205

166206
Required: False
@@ -175,7 +215,7 @@ Resource tags
175215
176216
```yaml
177217
Type: System.Collections.Hashtable
178-
Parameter Sets: (All)
218+
Parameter Sets: UpdateExpanded, UpdateViaIdentityExpanded
179219
Aliases:
180220

181221
Required: False
@@ -225,7 +265,7 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
225265
226266
## OUTPUTS
227267
228-
### Microsoft.Azure.PowerShell.Cmdlets.Portal.Models.Api20221201Preview.IDashboard
268+
### Microsoft.Azure.PowerShell.Cmdlets.Portal.Models.IDashboard
229269
230270
## NOTES
231271

0 commit comments

Comments
 (0)