Skip to content

Commit f0c2ef8

Browse files
authored
[Az.DeviceUpdate] Update generation tool version: autorest.powershell v3 -> v4 (#27622)
1 parent 1020487 commit f0c2ef8

34 files changed

+928
-286
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
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 - DeviceUpdate")]
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)]
27+
28+

src/DeviceUpdate/DeviceUpdate.Autorest/README.md

Lines changed: 7 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -38,17 +38,12 @@ title: DeviceUpdate
3838
module-version: 0.1.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
- where:
51-
variant: ^Create$|^CreateViaIdentity$|^CreateViaIdentityExpanded$|^Update$|^UpdateViaIdentity$
43+
variant: ^(Create|Update)(?!.*?(Expanded|JsonFilePath|JsonString))
44+
remove: true
45+
- where:
46+
variant: ^CreateViaIdentity$|^CreateViaIdentityExpanded$
5247
remove: true
5348
- where:
5449
verb: Set|Invoke
@@ -191,17 +186,11 @@ directive:
191186
- where:
192187
subject: PrivateLinkResource
193188
remove: true
194-
- where:
195-
parameter-name: IdentityUserAssignedIdentity
196-
set:
197-
parameter-name: UserAssignedIdentity
198189
- where:
199190
verb: New
200191
subject: Instance
201192
hide: true
202-
# The cmdlet's name to long, Re-name it
203-
# - model-cmdlet:
204-
# - IotHubSettings
205-
# - PrivateEndpointConnection
206-
# - CheckNameAvailabilityRequest
193+
- model-cmdlet:
194+
- model-name: CheckNameAvailabilityRequest
195+
cmdlet-name: New-AzDeviceUpdateCheckNameAvailabilityRequestObject
207196
```

src/DeviceUpdate/DeviceUpdate.Autorest/custom/New-AzDeviceUpdateInstance.ps1

Lines changed: 43 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,12 @@ IOTHUB <IIotHubSettings[]>: List of IoT Hubs associated with the account.
3636
https://learn.microsoft.com/powershell/module/az.deviceupdate/new-azdeviceupdateinstance
3737
#>
3838
function New-AzDeviceUpdateInstance {
39-
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DeviceUpdate.Models.Api20221001.IInstance])]
39+
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DeviceUpdate.Models.IInstance])]
4040
[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
4141
param(
42-
[Parameter(Mandatory)]
42+
[Parameter(ParameterSetName='CreateExpanded', Mandatory)]
43+
[Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)]
44+
[Parameter(ParameterSetName='CreateViaJsonString', Mandatory)]
4345
[Microsoft.Azure.PowerShell.Cmdlets.DeviceUpdate.Category('Path')]
4446
[System.String]
4547
# Account name.
@@ -52,64 +54,93 @@ param(
5254
# Instance name.
5355
${Name},
5456

55-
[Parameter(Mandatory)]
57+
[Parameter(ParameterSetName='CreateExpanded', Mandatory)]
58+
[Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)]
59+
[Parameter(ParameterSetName='CreateViaJsonString', Mandatory)]
5660
[Microsoft.Azure.PowerShell.Cmdlets.DeviceUpdate.Category('Path')]
5761
[System.String]
5862
# The resource group name.
5963
${ResourceGroupName},
6064

61-
[Parameter()]
65+
[Parameter(ParameterSetName='CreateExpanded')]
66+
[Parameter(ParameterSetName='CreateViaJsonFilePath')]
67+
[Parameter(ParameterSetName='CreateViaJsonString')]
6268
[Microsoft.Azure.PowerShell.Cmdlets.DeviceUpdate.Category('Path')]
6369
[Microsoft.Azure.PowerShell.Cmdlets.DeviceUpdate.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')]
6470
[System.String]
6571
# The Azure subscription ID.
6672
${SubscriptionId},
6773

68-
[Parameter(Mandatory)]
74+
[Parameter(ParameterSetName='CreateViaIdentityAccountExpanded', Mandatory, ValueFromPipeline)]
75+
[Microsoft.Azure.PowerShell.Cmdlets.DeviceUpdate.Category('Path')]
76+
[Microsoft.Azure.PowerShell.Cmdlets.DeviceUpdate.Models.IDeviceUpdateIdentity]
77+
# Identity Parameter
78+
${AccountInputObject},
79+
80+
[Parameter(ParameterSetName='CreateExpanded', Mandatory)]
81+
[Parameter(ParameterSetName='CreateViaIdentityAccountExpanded', Mandatory)]
6982
[Microsoft.Azure.PowerShell.Cmdlets.DeviceUpdate.Category('Body')]
7083
[System.String]
7184
# The geo-location where the resource lives
7285
${Location},
7386

74-
[Parameter()]
87+
[Parameter(ParameterSetName='CreateExpanded')]
88+
[Parameter(ParameterSetName='CreateViaIdentityAccountExpanded')]
7589
[Microsoft.Azure.PowerShell.Cmdlets.DeviceUpdate.Category('Body')]
7690
[System.String]
7791
# ConnectionString of the diagnostic storage account
7892
${DiagnosticStoragePropertyConnectionString},
7993

80-
[Parameter()]
94+
[Parameter(ParameterSetName='CreateExpanded')]
95+
[Parameter(ParameterSetName='CreateViaIdentityAccountExpanded')]
8196
[Microsoft.Azure.PowerShell.Cmdlets.DeviceUpdate.Category('Body')]
8297
[System.String]
8398
# ResourceId of the diagnostic storage account
8499
${DiagnosticStoragePropertyResourceId},
85100

86-
[Parameter()]
101+
[Parameter(ParameterSetName='CreateExpanded')]
102+
[Parameter(ParameterSetName='CreateViaIdentityAccountExpanded')]
87103
[Microsoft.Azure.PowerShell.Cmdlets.DeviceUpdate.Category('Body')]
88104
[System.Management.Automation.SwitchParameter]
89105
# Enables or Disables the diagnostic logs collection
90106
${EnableDiagnostic},
91107

92-
[Parameter()]
108+
[Parameter(ParameterSetName='CreateExpanded')]
109+
[Parameter(ParameterSetName='CreateViaIdentityAccountExpanded')]
93110
[AllowEmptyCollection()]
94111
[Microsoft.Azure.PowerShell.Cmdlets.DeviceUpdate.Category('Body')]
95112
[System.String[]]
96113
# List of IoT Hubs associated with the account.
97114
# To construct, see NOTES section for IOTHUB properties and create a hash table.
98115
${IotHubId},
99116

100-
[Parameter()]
117+
[Parameter(ParameterSetName='CreateExpanded')]
118+
[Parameter(ParameterSetName='CreateViaIdentityAccountExpanded')]
101119
[Microsoft.Azure.PowerShell.Cmdlets.DeviceUpdate.Category('Body')]
102-
[Microsoft.Azure.PowerShell.Cmdlets.DeviceUpdate.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.DeviceUpdate.Models.Api30.ITrackedResourceTags]))]
120+
[Microsoft.Azure.PowerShell.Cmdlets.DeviceUpdate.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.DeviceUpdate.Models.ITrackedResourceTags]))]
103121
[System.Collections.Hashtable]
104122
# Resource tags.
105123
${Tag},
106124

125+
[Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)]
126+
[Microsoft.Azure.PowerShell.Cmdlets.DeviceUpdate.Category('Body')]
127+
[System.String]
128+
# Path of Json file supplied to the Create operation
129+
${JsonFilePath},
130+
131+
[Parameter(ParameterSetName='CreateViaJsonString', Mandatory)]
132+
[Microsoft.Azure.PowerShell.Cmdlets.DeviceUpdate.Category('Body')]
133+
[System.String]
134+
# Json string supplied to the Create operation
135+
${JsonString},
136+
107137
[Parameter()]
108138
[Alias('AzureRMContext', 'AzureCredential')]
109139
[ValidateNotNull()]
110140
[Microsoft.Azure.PowerShell.Cmdlets.DeviceUpdate.Category('Azure')]
111141
[System.Management.Automation.PSObject]
112-
# The credentials, account, tenant, and subscription used for communication with Azure.
142+
# The DefaultProfile parameter is not functional.
143+
# Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.
113144
${DefaultProfile},
114145

115146
[Parameter()]

src/DeviceUpdate/DeviceUpdate.Autorest/custom/New-AzDeviceUpdateCheckNameAvailabilityRequestObject.ps1 renamed to src/DeviceUpdate/DeviceUpdate.Autorest/custom/autogen-model-cmdlets/New-AzDeviceUpdateCheckNameAvailabilityRequestObject.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 CheckNameAvailabilityRequest.
2121
Create an in-memory object for CheckNameAvailabilityRequest.
2222
2323
.Outputs
24-
Microsoft.Azure.PowerShell.Cmdlets.DeviceUpdate.Models.Api30.CheckNameAvailabilityRequest
24+
Microsoft.Azure.PowerShell.Cmdlets.DeviceUpdate.Models.CheckNameAvailabilityRequest
2525
.Link
26-
https://learn.microsoft.com/powershell/module/az.DeviceUpdate/new-AzDeviceUpdateCheckNameAvailabilityRequestObject
26+
https://learn.microsoft.com/powershell/module/Az.DeviceUpdate/new-azdeviceupdatechecknameavailabilityrequestobject
2727
#>
2828
function New-AzDeviceUpdateCheckNameAvailabilityRequestObject {
29-
[OutputType('Microsoft.Azure.PowerShell.Cmdlets.DeviceUpdate.Models.Api30.CheckNameAvailabilityRequest')]
29+
[Microsoft.Azure.PowerShell.Cmdlets.DeviceUpdate.ModelCmdletAttribute()]
30+
[OutputType('Microsoft.Azure.PowerShell.Cmdlets.DeviceUpdate.Models.CheckNameAvailabilityRequest')]
3031
[CmdletBinding(PositionalBinding=$false)]
3132
Param(
3233

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

4142
process {
42-
$Object = [Microsoft.Azure.PowerShell.Cmdlets.DeviceUpdate.Models.Api30.CheckNameAvailabilityRequest]::New()
43+
$Object = [Microsoft.Azure.PowerShell.Cmdlets.DeviceUpdate.Models.CheckNameAvailabilityRequest]::New()
4344

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

src/DeviceUpdate/DeviceUpdate.Autorest/docs/Az.DeviceUpdate.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
Module Name: Az.DeviceUpdate
3-
Module Guid: 47841c04-1681-4e5e-884e-afb3faf25061
3+
Module Guid: 7ccf1a98-2bbc-4c3f-8f8f-ad4c17fc1625
44
Download Help Link: https://learn.microsoft.com/powershell/module/az.deviceupdate
55
Help Version: 1.0.0.0
66
Locale: en-US
@@ -18,7 +18,7 @@ Returns account details for the given account name.
1818
Returns instance details for the given instance and account name.
1919

2020
### [New-AzDeviceUpdateAccount](New-AzDeviceUpdateAccount.md)
21-
Creates or updates Account.
21+
create Account.
2222

2323
### [New-AzDeviceUpdateCheckNameAvailabilityRequestObject](New-AzDeviceUpdateCheckNameAvailabilityRequestObject.md)
2424
Create an in-memory object for CheckNameAvailabilityRequest.
@@ -36,8 +36,8 @@ Deletes instance.
3636
Checks ADU resource name availability.
3737

3838
### [Update-AzDeviceUpdateAccount](Update-AzDeviceUpdateAccount.md)
39-
Updates account's patchable properties
39+
update Account.
4040

4141
### [Update-AzDeviceUpdateInstance](Update-AzDeviceUpdateInstance.md)
42-
Updates instance's tags.
42+
update instance's tags.
4343

src/DeviceUpdate/DeviceUpdate.Autorest/docs/Get-AzDeviceUpdateAccount.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,6 @@ Accept wildcard characters: False
9999
100100
### -InputObject
101101
Identity Parameter
102-
To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
103102
104103
```yaml
105104
Type: Microsoft.Azure.PowerShell.Cmdlets.DeviceUpdate.Models.IDeviceUpdateIdentity
@@ -167,7 +166,7 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
167166
168167
## OUTPUTS
169168
170-
### Microsoft.Azure.PowerShell.Cmdlets.DeviceUpdate.Models.Api20221001.IAccount
169+
### Microsoft.Azure.PowerShell.Cmdlets.DeviceUpdate.Models.IAccount
171170
172171
## NOTES
173172

src/DeviceUpdate/DeviceUpdate.Autorest/docs/Get-AzDeviceUpdateInstance.md

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,12 @@ Get-AzDeviceUpdateInstance -InputObject <IDeviceUpdateIdentity> [-DefaultProfile
3030
[<CommonParameters>]
3131
```
3232

33+
### GetViaIdentityAccount
34+
```
35+
Get-AzDeviceUpdateInstance -AccountInputObject <IDeviceUpdateIdentity> -Name <String>
36+
[-DefaultProfile <PSObject>] [<CommonParameters>]
37+
```
38+
3339
## DESCRIPTION
3440
Returns instance details for the given instance and account name.
3541

@@ -63,6 +69,21 @@ Returns instance details for the given instance and account name.
6369

6470
## PARAMETERS
6571

72+
### -AccountInputObject
73+
Identity Parameter
74+
75+
```yaml
76+
Type: Microsoft.Azure.PowerShell.Cmdlets.DeviceUpdate.Models.IDeviceUpdateIdentity
77+
Parameter Sets: GetViaIdentityAccount
78+
Aliases:
79+
80+
Required: True
81+
Position: Named
82+
Default value: None
83+
Accept pipeline input: True (ByValue)
84+
Accept wildcard characters: False
85+
```
86+
6687
### -AccountName
6788
Account name.
6889
@@ -96,7 +117,6 @@ Accept wildcard characters: False
96117
97118
### -InputObject
98119
Identity Parameter
99-
To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
100120
101121
```yaml
102122
Type: Microsoft.Azure.PowerShell.Cmdlets.DeviceUpdate.Models.IDeviceUpdateIdentity
@@ -115,7 +135,7 @@ Instance name.
115135
116136
```yaml
117137
Type: System.String
118-
Parameter Sets: Get
138+
Parameter Sets: Get, GetViaIdentityAccount
119139
Aliases: InstanceName
120140

121141
Required: True
@@ -164,7 +184,7 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
164184
165185
## OUTPUTS
166186
167-
### Microsoft.Azure.PowerShell.Cmdlets.DeviceUpdate.Models.Api20221001.IInstance
187+
### Microsoft.Azure.PowerShell.Cmdlets.DeviceUpdate.Models.IInstance
168188
169189
## NOTES
170190

0 commit comments

Comments
 (0)