Skip to content

Commit 7ca1cd8

Browse files
authored
[PS] migrate WindowsIotServices module to autorest v4 (Azure#27459)
1 parent 3df698d commit 7ca1cd8

17 files changed

+359
-105
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 - WindowsIotServices")]
23+
[assembly: System.Reflection.AssemblyFileVersionAttribute("0.1.2")]
24+
[assembly: System.Reflection.AssemblyVersionAttribute("0.1.2")]
25+
[assembly: System.Runtime.InteropServices.ComVisibleAttribute(false)]
26+
[assembly: System.CLSCompliantAttribute(false)]

src/WindowsIotServices/WindowsIotServices.Autorest/README.md

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,6 @@ title: WindowsIotServices
3838
module-version: 0.1.0
3939
subject-prefix: WindowsIotServices
4040

41-
# For new modules, please avoid setting 3.x using the use-extension method and instead, use 4.x as the default option
42-
use-extension:
43-
"@autorest/powershell": "3.x"
44-
4541
directive:
4642
# Changed schema ref of the patch and put request.
4743
- from: swagger-document
@@ -85,14 +81,12 @@ directive:
8581
remove: true
8682
# Remove parameter set name
8783
- where:
88-
verb: New
8984
subject: Service$
90-
variant: Create$|CreateViaIdentity$|CreateViaIdentityExpanded$
85+
variant: ^(Create|Update)(?!.*?(Expanded|JsonFilePath|JsonString))
9186
remove: true
9287
- where:
93-
verb: Update
9488
subject: Service$
95-
variant: Update$|UpdateViaIdentity$
89+
variant: ^CreateViaIdentity$|^CreateViaIdentityExpanded$
9690
remove: true
9791
# Rename parameter name
9892
- where:
@@ -111,4 +105,13 @@ directive:
111105
subject: Service$
112106
set:
113107
subject: Device
108+
# if update Location parameter available, please uncommit this
109+
# - from: swagger-document
110+
# where: $.definitions.TrackedResource.properties.location.x-ms-mutability
111+
# transform: >-
112+
# return [
113+
# "read",
114+
# "update",
115+
# "create"
116+
# ]
114117
```

src/WindowsIotServices/WindowsIotServices.Autorest/docs/Az.WindowsIotServices.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
Module Name: Az.WindowsIotServices
3-
Module Guid: d5c7f2ce-fe23-49d5-a869-fb780e78a663
3+
Module Guid: b8c0fd61-5572-4480-9641-523c06ddb44c
44
Download Help Link: https://learn.microsoft.com/powershell/module/az.windowsiotservices
55
Help Version: 1.0.0.0
66
Locale: en-US
@@ -15,13 +15,13 @@ Microsoft Azure PowerShell: WindowsIotServices cmdlets
1515
Get the non-security related metadata of a Windows IoT Device Service.
1616

1717
### [New-AzWindowsIotServicesDevice](New-AzWindowsIotServicesDevice.md)
18-
Create or update the metadata of a Windows IoT Device Service.
19-
The usual pattern to modify a property is to retrieve the Windows IoT Device Service metadata and security metadata, and then combine them with the modified values in a new body to update the Windows IoT Device Service.
18+
create the metadata of a Windows IoT Device Service.
19+
The usual pattern to modify a property is to retrieve the Windows IoT Device Service metadata and security metadata, and then combine them with the modified values in a new body to create the Windows IoT Device Service.
2020

2121
### [Remove-AzWindowsIotServicesDevice](Remove-AzWindowsIotServicesDevice.md)
2222
Delete a Windows IoT Device Service.
2323

2424
### [Update-AzWindowsIotServicesDevice](Update-AzWindowsIotServicesDevice.md)
25-
Updates the metadata of a Windows IoT Device Service.
25+
update the metadata of a Windows IoT Device Service.
2626
The usual pattern to modify a property is to retrieve the Windows IoT Device Service metadata and security metadata, and then combine them with the modified values in a new body to update the Windows IoT Device Service.
2727

src/WindowsIotServices/WindowsIotServices.Autorest/docs/Get-AzWindowsIotServicesDevice.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,6 @@ Accept wildcard characters: False
128128
129129
### -InputObject
130130
Identity Parameter
131-
To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
132131
133132
```yaml
134133
Type: Microsoft.Azure.PowerShell.Cmdlets.WindowsIotServices.Models.IWindowsIotServicesIdentity
@@ -196,7 +195,7 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
196195
197196
## OUTPUTS
198197
199-
### Microsoft.Azure.PowerShell.Cmdlets.WindowsIotServices.Models.Api20190601.IDeviceService
198+
### Microsoft.Azure.PowerShell.Cmdlets.WindowsIotServices.Models.IDeviceService
200199
201200
## NOTES
202201

src/WindowsIotServices/WindowsIotServices.Autorest/docs/New-AzWindowsIotServicesDevice.md

Lines changed: 57 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,36 @@ schema: 2.0.0
88
# New-AzWindowsIotServicesDevice
99

1010
## SYNOPSIS
11-
Create or update the metadata of a Windows IoT Device Service.
12-
The usual pattern to modify a property is to retrieve the Windows IoT Device Service metadata and security metadata, and then combine them with the modified values in a new body to update the Windows IoT Device Service.
11+
create the metadata of a Windows IoT Device Service.
12+
The usual pattern to modify a property is to retrieve the Windows IoT Device Service metadata and security metadata, and then combine them with the modified values in a new body to create the Windows IoT Device Service.
1313

1414
## SYNTAX
1515

16+
### CreateExpanded (Default)
1617
```
1718
New-AzWindowsIotServicesDevice -Name <String> -ResourceGroupName <String> [-SubscriptionId <String>]
1819
[-IfMatch <String>] [-AdminDomainName <String>] [-BillingDomainName <String>] [-Etag <String>]
1920
[-Location <String>] [-Note <String>] [-Quantity <Int64>] [-Tag <Hashtable>] [-DefaultProfile <PSObject>]
2021
[-Confirm] [-WhatIf] [<CommonParameters>]
2122
```
2223

24+
### CreateViaJsonFilePath
25+
```
26+
New-AzWindowsIotServicesDevice -Name <String> -ResourceGroupName <String> -JsonFilePath <String>
27+
[-SubscriptionId <String>] [-IfMatch <String>] [-DefaultProfile <PSObject>] [-Confirm] [-WhatIf]
28+
[<CommonParameters>]
29+
```
30+
31+
### CreateViaJsonString
32+
```
33+
New-AzWindowsIotServicesDevice -Name <String> -ResourceGroupName <String> -JsonString <String>
34+
[-SubscriptionId <String>] [-IfMatch <String>] [-DefaultProfile <PSObject>] [-Confirm] [-WhatIf]
35+
[<CommonParameters>]
36+
```
37+
2338
## DESCRIPTION
24-
Create or update the metadata of a Windows IoT Device Service.
25-
The usual pattern to modify a property is to retrieve the Windows IoT Device Service metadata and security metadata, and then combine them with the modified values in a new body to update the Windows IoT Device Service.
39+
create the metadata of a Windows IoT Device Service.
40+
The usual pattern to modify a property is to retrieve the Windows IoT Device Service metadata and security metadata, and then combine them with the modified values in a new body to create the Windows IoT Device Service.
2641

2742
## EXAMPLES
2843

@@ -46,7 +61,7 @@ Windows IoT Device Service OEM AAD domain
4661

4762
```yaml
4863
Type: System.String
49-
Parameter Sets: (All)
64+
Parameter Sets: CreateExpanded
5065
Aliases:
5166

5267
Required: False
@@ -61,7 +76,7 @@ Windows IoT Device Service ODM AAD domain
6176
6277
```yaml
6378
Type: System.String
64-
Parameter Sets: (All)
79+
Parameter Sets: CreateExpanded
6580
Aliases:
6681

6782
Required: False
@@ -93,7 +108,7 @@ If it is provided in the response body, it must also be provided as a header per
93108
94109
```yaml
95110
Type: System.String
96-
Parameter Sets: (All)
111+
Parameter Sets: CreateExpanded
97112
Aliases:
98113

99114
Required: False
@@ -120,12 +135,42 @@ Accept pipeline input: False
120135
Accept wildcard characters: False
121136
```
122137
138+
### -JsonFilePath
139+
Path of Json file supplied to the Create operation
140+
141+
```yaml
142+
Type: System.String
143+
Parameter Sets: CreateViaJsonFilePath
144+
Aliases:
145+
146+
Required: True
147+
Position: Named
148+
Default value: None
149+
Accept pipeline input: False
150+
Accept wildcard characters: False
151+
```
152+
153+
### -JsonString
154+
Json string supplied to the Create operation
155+
156+
```yaml
157+
Type: System.String
158+
Parameter Sets: CreateViaJsonString
159+
Aliases:
160+
161+
Required: True
162+
Position: Named
163+
Default value: None
164+
Accept pipeline input: False
165+
Accept wildcard characters: False
166+
```
167+
123168
### -Location
124169
The Azure Region where the resource lives
125170
126171
```yaml
127172
Type: System.String
128-
Parameter Sets: (All)
173+
Parameter Sets: CreateExpanded
129174
Aliases:
130175

131176
Required: False
@@ -155,7 +200,7 @@ Windows IoT Device Service notes.
155200
156201
```yaml
157202
Type: System.String
158-
Parameter Sets: (All)
203+
Parameter Sets: CreateExpanded
159204
Aliases:
160205

161206
Required: False
@@ -170,7 +215,7 @@ Windows IoT Device Service device allocation,
170215
171216
```yaml
172217
Type: System.Int64
173-
Parameter Sets: (All)
218+
Parameter Sets: CreateExpanded
174219
Aliases:
175220

176221
Required: False
@@ -215,7 +260,7 @@ Resource tags.
215260
216261
```yaml
217262
Type: System.Collections.Hashtable
218-
Parameter Sets: (All)
263+
Parameter Sets: CreateExpanded
219264
Aliases:
220265

221266
Required: False
@@ -263,7 +308,7 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
263308
264309
## OUTPUTS
265310
266-
### Microsoft.Azure.PowerShell.Cmdlets.WindowsIotServices.Models.Api20190601.IDeviceService
311+
### Microsoft.Azure.PowerShell.Cmdlets.WindowsIotServices.Models.IDeviceService
267312
268313
## NOTES
269314

src/WindowsIotServices/WindowsIotServices.Autorest/docs/Remove-AzWindowsIotServicesDevice.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ Accept wildcard characters: False
6666
6767
### -InputObject
6868
Identity Parameter
69-
To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
7069
7170
```yaml
7271
Type: Microsoft.Azure.PowerShell.Cmdlets.WindowsIotServices.Models.IWindowsIotServicesIdentity
@@ -165,7 +164,7 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
165164
166165
## OUTPUTS
167166
168-
### Microsoft.Azure.PowerShell.Cmdlets.WindowsIotServices.Models.Api20190601.IDeviceService
167+
### Microsoft.Azure.PowerShell.Cmdlets.WindowsIotServices.Models.IDeviceService
169168
170169
## NOTES
171170

0 commit comments

Comments
 (0)