Skip to content

[PS] migrate WindowsIotServices module to autorest v4 #27459

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

Merged
merged 4 commits into from
Apr 8, 2025
Merged
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
@@ -0,0 +1,26 @@
// 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 - WindowsIotServices")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("0.1.2")]
[assembly: System.Reflection.AssemblyVersionAttribute("0.1.2")]
[assembly: System.Runtime.InteropServices.ComVisibleAttribute(false)]
[assembly: System.CLSCompliantAttribute(false)]
19 changes: 11 additions & 8 deletions src/WindowsIotServices/WindowsIotServices.Autorest/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,6 @@ title: WindowsIotServices
module-version: 0.1.0
subject-prefix: WindowsIotServices

# 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:
# Changed schema ref of the patch and put request.
- from: swagger-document
Expand Down Expand Up @@ -85,14 +81,12 @@ directive:
remove: true
# Remove parameter set name
- where:
verb: New
subject: Service$
variant: Create$|CreateViaIdentity$|CreateViaIdentityExpanded$
variant: ^(Create|Update)(?!.*?(Expanded|JsonFilePath|JsonString))
remove: true
- where:
verb: Update
subject: Service$
variant: Update$|UpdateViaIdentity$
variant: ^CreateViaIdentity$|^CreateViaIdentityExpanded$
remove: true
# Rename parameter name
- where:
Expand All @@ -111,4 +105,13 @@ directive:
subject: Service$
set:
subject: Device
# if update Location parameter available, please uncommit this
# - from: swagger-document
# where: $.definitions.TrackedResource.properties.location.x-ms-mutability
# transform: >-
# return [
# "read",
# "update",
# "create"
# ]
```
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
Module Name: Az.WindowsIotServices
Module Guid: d5c7f2ce-fe23-49d5-a869-fb780e78a663
Module Guid: b8c0fd61-5572-4480-9641-523c06ddb44c
Download Help Link: https://learn.microsoft.com/powershell/module/az.windowsiotservices
Help Version: 1.0.0.0
Locale: en-US
Expand All @@ -15,13 +15,13 @@ Microsoft Azure PowerShell: WindowsIotServices cmdlets
Get the non-security related metadata of a Windows IoT Device Service.

### [New-AzWindowsIotServicesDevice](New-AzWindowsIotServicesDevice.md)
Create or update the metadata of a Windows IoT Device Service.
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.
create the metadata of a Windows IoT Device Service.
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.

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

### [Update-AzWindowsIotServicesDevice](Update-AzWindowsIotServicesDevice.md)
Updates the metadata of a Windows IoT Device Service.
update the metadata of a Windows IoT Device Service.
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.

Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,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.WindowsIotServices.Models.IWindowsIotServicesIdentity
Expand Down Expand Up @@ -196,7 +195,7 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable

## OUTPUTS

### Microsoft.Azure.PowerShell.Cmdlets.WindowsIotServices.Models.Api20190601.IDeviceService
### Microsoft.Azure.PowerShell.Cmdlets.WindowsIotServices.Models.IDeviceService

## NOTES

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,36 @@ schema: 2.0.0
# New-AzWindowsIotServicesDevice

## SYNOPSIS
Create or update the metadata of a Windows IoT Device Service.
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.
create the metadata of a Windows IoT Device Service.
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.

## SYNTAX

### CreateExpanded (Default)
```
New-AzWindowsIotServicesDevice -Name <String> -ResourceGroupName <String> [-SubscriptionId <String>]
[-IfMatch <String>] [-AdminDomainName <String>] [-BillingDomainName <String>] [-Etag <String>]
[-Location <String>] [-Note <String>] [-Quantity <Int64>] [-Tag <Hashtable>] [-DefaultProfile <PSObject>]
[-Confirm] [-WhatIf] [<CommonParameters>]
```

### CreateViaJsonFilePath
```
New-AzWindowsIotServicesDevice -Name <String> -ResourceGroupName <String> -JsonFilePath <String>
[-SubscriptionId <String>] [-IfMatch <String>] [-DefaultProfile <PSObject>] [-Confirm] [-WhatIf]
[<CommonParameters>]
```

### CreateViaJsonString
```
New-AzWindowsIotServicesDevice -Name <String> -ResourceGroupName <String> -JsonString <String>
[-SubscriptionId <String>] [-IfMatch <String>] [-DefaultProfile <PSObject>] [-Confirm] [-WhatIf]
[<CommonParameters>]
```

## DESCRIPTION
Create or update the metadata of a Windows IoT Device Service.
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.
create the metadata of a Windows IoT Device Service.
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.

## EXAMPLES

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

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

Required: False
Expand All @@ -61,7 +76,7 @@ Windows IoT Device Service ODM AAD domain

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

Required: False
Expand Down Expand Up @@ -93,7 +108,7 @@ If it is provided in the response body, it must also be provided as a header per

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

Required: False
Expand All @@ -120,12 +135,42 @@ Accept pipeline input: False
Accept wildcard characters: False
```

### -JsonFilePath
Path of Json file supplied to the Create operation

```yaml
Type: System.String
Parameter Sets: CreateViaJsonFilePath
Aliases:

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

### -JsonString
Json string supplied to the Create operation

```yaml
Type: System.String
Parameter Sets: CreateViaJsonString
Aliases:

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

### -Location
The Azure Region where the resource lives

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

Required: False
Expand Down Expand Up @@ -155,7 +200,7 @@ Windows IoT Device Service notes.

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

Required: False
Expand All @@ -170,7 +215,7 @@ Windows IoT Device Service device allocation,

```yaml
Type: System.Int64
Parameter Sets: (All)
Parameter Sets: CreateExpanded
Aliases:

Required: False
Expand Down Expand Up @@ -215,7 +260,7 @@ Resource tags.

```yaml
Type: System.Collections.Hashtable
Parameter Sets: (All)
Parameter Sets: CreateExpanded
Aliases:

Required: False
Expand Down Expand Up @@ -263,7 +308,7 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable

## OUTPUTS

### Microsoft.Azure.PowerShell.Cmdlets.WindowsIotServices.Models.Api20190601.IDeviceService
### Microsoft.Azure.PowerShell.Cmdlets.WindowsIotServices.Models.IDeviceService

## NOTES

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,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.WindowsIotServices.Models.IWindowsIotServicesIdentity
Expand Down Expand Up @@ -165,7 +164,7 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable

## OUTPUTS

### Microsoft.Azure.PowerShell.Cmdlets.WindowsIotServices.Models.Api20190601.IDeviceService
### Microsoft.Azure.PowerShell.Cmdlets.WindowsIotServices.Models.IDeviceService

## NOTES

Expand Down
Loading