Skip to content

Commit e25d43f

Browse files
committed
migrate LoadTesting to autorest v4
1 parent b9cd199 commit e25d43f

19 files changed

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

src/LoadTesting/LoadTesting.Autorest/README.md

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -36,16 +36,13 @@ input-file:
3636
title: LoadTesting
3737
module-version: 0.1.0
3838
subject-prefix: ""
39-
40-
resourcegroup-append: true
41-
nested-object-to-string: true
4239
inlining-threshold: 200
4340

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"
47-
4841
directive:
42+
- where:
43+
variant: ^(Create|Update)(?!.*?(Expanded|JsonFilePath|JsonString))|^CreateViaIdentityExpanded$
44+
remove: true
45+
4946
# https://stackoverflow.microsoft.com/questions/333196
5047
- where:
5148
subject: .*Quota.*
@@ -61,10 +58,6 @@ directive:
6158
set:
6259
subject: Load
6360

64-
- where:
65-
variant: ^Create$|^Update$|.*ViaIdentity$|.*ViaIdentityExpanded$
66-
remove: true
67-
6861
# Removing Set command
6962
- where:
7063
verb: Set
@@ -142,7 +135,7 @@ directive:
142135
# Hiding redundant SystemData property
143136
- from: source-file-csharp
144137
where: $
145-
transform: $ = $.replace('public Microsoft.Azure.PowerShell.Cmdlets.LoadTesting.Models.Api30.ISystemData SystemData', 'private Microsoft.Azure.PowerShell.Cmdlets.LoadTesting.Models.Api30.ISystemData SystemData');
138+
transform: $ = $.replace('public Microsoft.Azure.PowerShell.Cmdlets.LoadTesting.Models.ISystemData SystemData', 'private Microsoft.Azure.PowerShell.Cmdlets.LoadTesting.Models.ISystemData SystemData');
146139

147140
- from: source-file-csharp
148141
where: $
@@ -252,11 +245,13 @@ directive:
252245
- where:
253246
verb: New
254247
subject: Load
248+
variant: ^CreateExpanded$
255249
hide: true
256250

257251
- where:
258252
verb: Update
259253
subject: Load
254+
variant: ^UpdateExpanded$
260255
hide: true
261256

262257
- where:

src/LoadTesting/LoadTesting.Autorest/custom/Get-AzLoad.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,12 @@ Get the details of an Azure Load Testing resource.
2525
{{ Add code here }}
2626
2727
.Outputs
28-
Microsoft.Azure.PowerShell.Cmdlets.LoadTesting.Models.Api20221201.ILoadTestResource
28+
Microsoft.Azure.PowerShell.Cmdlets.LoadTesting.Models.ILoadTestResource
2929
.Link
3030
https://learn.microsoft.com/powershell/module/az.loadtesting/get-azload
3131
#>
3232
function Get-AzLoad {
33-
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.LoadTesting.Models.Api20221201.ILoadTestResource])]
33+
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.LoadTesting.Models.ILoadTestResource])]
3434
[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)]
3535
param(
3636
[Parameter(ParameterSetName='Get', Mandatory)]

src/LoadTesting/LoadTesting.Autorest/custom/LoadTestResourceCustom.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// Code generated by Microsoft (R) AutoRest Code Generator.
44
// Changes may cause incorrect behavior and will be lost if the code is regenerated.
55

6-
namespace Microsoft.Azure.PowerShell.Cmdlets.LoadTesting.Models.Api20221201
6+
namespace Microsoft.Azure.PowerShell.Cmdlets.LoadTesting.Models
77
{
88
using static Microsoft.Azure.PowerShell.Cmdlets.LoadTesting.Runtime.Extensions;
99

src/LoadTesting/LoadTesting.Autorest/custom/New-AzLoad.ps1

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,12 @@ Creates a new Azure Load Testing resource in the resource group.
2525
{{ Add code here }}
2626
2727
.Outputs
28-
Microsoft.Azure.PowerShell.Cmdlets.LoadTesting.Models.Api20221201.ILoadTestResource
28+
Microsoft.Azure.PowerShell.Cmdlets.LoadTesting.Models.ILoadTestResource
2929
.Link
3030
https://learn.microsoft.com/powershell/module/az.loadtesting/new-azload
3131
#>
3232
function New-AzLoad {
33-
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.LoadTesting.Models.Api20221201.ILoadTestResource])]
33+
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.LoadTesting.Models.ILoadTestResource])]
3434
[CmdletBinding(PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
3535
param(
3636
[Parameter(Mandatory)]
@@ -74,15 +74,15 @@ function New-AzLoad {
7474
${EncryptionKey},
7575

7676
[Parameter(ParameterSetName='CreateExpanded')]
77-
[ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.LoadTesting.Support.ManagedServiceIdentityType])]
77+
[Microsoft.Azure.PowerShell.Cmdlets.LoadTesting.PSArgumentCompleterAttribute("SystemAssigned", "UserAssigned")]
7878
[Microsoft.Azure.PowerShell.Cmdlets.LoadTesting.Category('Body')]
79-
[Microsoft.Azure.PowerShell.Cmdlets.LoadTesting.Support.ManagedServiceIdentityType]
79+
[System.String]
8080
# Type of managed identity.
8181
${IdentityType},
8282

8383
[Parameter(ParameterSetName='CreateExpanded')]
8484
[Microsoft.Azure.PowerShell.Cmdlets.LoadTesting.Category('Body')]
85-
[Microsoft.Azure.PowerShell.Cmdlets.LoadTesting.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.LoadTesting.Models.Api50.IUserAssignedIdentities]))]
85+
[Microsoft.Azure.PowerShell.Cmdlets.LoadTesting.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.LoadTesting.Models.IUserAssignedIdentities]))]
8686
[System.Collections.Hashtable]
8787
# The list of user assigned identities associated with the resource. The user identity will be ARM resource ids.
8888
# The User Assigned Identity is a hashtable with keys in the form of an ARM resource id '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}.
@@ -91,7 +91,7 @@ function New-AzLoad {
9191

9292
[Parameter(ParameterSetName='CreateExpanded')]
9393
[Microsoft.Azure.PowerShell.Cmdlets.LoadTesting.Category('Body')]
94-
[Microsoft.Azure.PowerShell.Cmdlets.LoadTesting.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.LoadTesting.Models.Api30.ITrackedResourceTags]))]
94+
[Microsoft.Azure.PowerShell.Cmdlets.LoadTesting.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.LoadTesting.Models.ITrackedResourceTags]))]
9595
[System.Collections.Hashtable]
9696
# Key-value pairs in the form of a hash table set as tags on the server. For example: @{key0="value0";key1=$null;key2="value2"}.
9797
${Tag},

src/LoadTesting/LoadTesting.Autorest/custom/Update-AzLoad.ps1

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,12 @@ Updates an Azure Load Testing resource in a given resource group.
2525
{{ Add code here }}
2626
2727
.Outputs
28-
Microsoft.Azure.PowerShell.Cmdlets.LoadTesting.Models.Api20221201.ILoadTestResource
28+
Microsoft.Azure.PowerShell.Cmdlets.LoadTesting.Models.ILoadTestResource
2929
.Link
3030
https://learn.microsoft.com/powershell/module/az.loadtesting/update-azload
3131
#>
3232
function Update-AzLoad {
33-
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.LoadTesting.Models.Api20221201.ILoadTestResource])]
33+
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.LoadTesting.Models.ILoadTestResource])]
3434
[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
3535
param(
3636
[Parameter(Mandatory)]
@@ -68,15 +68,15 @@ function Update-AzLoad {
6868
${EncryptionKey},
6969

7070
[Parameter()]
71-
[ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.LoadTesting.Support.ManagedServiceIdentityType])]
71+
[Microsoft.Azure.PowerShell.Cmdlets.LoadTesting.PSArgumentCompleterAttribute("SystemAssigned", "UserAssigned")]
7272
[Microsoft.Azure.PowerShell.Cmdlets.LoadTesting.Category('Body')]
73-
[Microsoft.Azure.PowerShell.Cmdlets.LoadTesting.Support.ManagedServiceIdentityType]
73+
[System.String]
7474
# Type of managed identity.
7575
${IdentityType},
7676

7777
[Parameter()]
7878
[Microsoft.Azure.PowerShell.Cmdlets.LoadTesting.Category('Body')]
79-
[Microsoft.Azure.PowerShell.Cmdlets.LoadTesting.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.LoadTesting.Models.Api50.IUserAssignedIdentities]))]
79+
[Microsoft.Azure.PowerShell.Cmdlets.LoadTesting.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.LoadTesting.Models.IUserAssignedIdentities]))]
8080
[System.Collections.Hashtable]
8181
# The list of user assigned identities associated with the resource. The user identity will be ARM resource ids.
8282
# The User Assigned Identity is a hashtable with keys in the form of an ARM resource id '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}.
@@ -85,7 +85,7 @@ function Update-AzLoad {
8585

8686
[Parameter()]
8787
[Microsoft.Azure.PowerShell.Cmdlets.LoadTesting.Category('Body')]
88-
[Microsoft.Azure.PowerShell.Cmdlets.LoadTesting.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.LoadTesting.Models.Api20221201.ILoadTestResourcePatchRequestBodyTags]))]
88+
[Microsoft.Azure.PowerShell.Cmdlets.LoadTesting.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.LoadTesting.Models.ILoadTestResourcePatchRequestBodyTags]))]
8989
[System.Collections.Hashtable]
9090
# Key-value pairs in the form of a hash table set as tags on the server. For example: @{key0="value0";key1=$null;key2="value2"}.
9191
${Tag},

src/LoadTesting/LoadTesting.Autorest/custom/UserAssignedIdentitiesCustom.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// Code generated by Microsoft (R) AutoRest Code Generator.
44
// Changes may cause incorrect behavior and will be lost if the code is regenerated.
55

6-
namespace Microsoft.Azure.PowerShell.Cmdlets.LoadTesting.Models.Api50
6+
namespace Microsoft.Azure.PowerShell.Cmdlets.LoadTesting.Models
77
{
88
using static Microsoft.Azure.PowerShell.Cmdlets.LoadTesting.Runtime.Extensions;
99
public partial class UserAssignedIdentities

src/LoadTesting/LoadTesting.Autorest/docs/Az.LoadTesting.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
Module Name: Az.LoadTesting
3-
Module Guid: 739ddedf-3d49-40e0-bc84-00bedfe6b2ec
3+
Module Guid: ff12ec77-2eea-44bd-a3f0-1076cb249c14
44
Download Help Link: https://learn.microsoft.com/powershell/module/az.loadtesting
55
Help Version: 1.0.0.0
66
Locale: en-US
@@ -15,11 +15,11 @@ Microsoft Azure PowerShell: LoadTesting cmdlets
1515
Get the details of an Azure Load Testing resource.
1616

1717
### [New-AzLoad](New-AzLoad.md)
18-
Create a new Azure Load Testing resource.
18+
Create LoadTest resource.
1919

2020
### [Remove-AzLoad](Remove-AzLoad.md)
2121
Delete an Azure Load Testing resource.
2222

2323
### [Update-AzLoad](Update-AzLoad.md)
24-
Update an Azure Load Testing resource.
24+
Update LoadTest resource.
2525

src/LoadTesting/LoadTesting.Autorest/docs/Get-AzLoad.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
144144
145145
## OUTPUTS
146146
147-
### Microsoft.Azure.PowerShell.Cmdlets.LoadTesting.Models.Api20221201.ILoadTestResource
147+
### Microsoft.Azure.PowerShell.Cmdlets.LoadTesting.Models.ILoadTestResource
148148
149149
## NOTES
150150

0 commit comments

Comments
 (0)