Skip to content

Commit 60fa0e7

Browse files
authored
[PS] migrate VoiceServices module to autorest v4 (#27463)
1 parent 568a04b commit 60fa0e7

30 files changed

+881
-169
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 - MicrosoftVoiceServices")]
23+
[assembly: System.Reflection.AssemblyFileVersionAttribute("0.1.3")]
24+
[assembly: System.Reflection.AssemblyVersionAttribute("0.1.3")]
25+
[assembly: System.Runtime.InteropServices.ComVisibleAttribute(false)]
26+
[assembly: System.CLSCompliantAttribute(false)]

src/VoiceServices/VoiceServices.Autorest/README.md

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,6 @@ try-require:
4242
subject-prefix: $(service-name)
4343

4444
inlining-threshold: 100
45-
resourcegroup-append: true
46-
nested-object-to-string: true
47-
48-
# For new modules, please avoid setting 3.x using the use-extension method and instead, use 4.x as the default option
49-
use-extension:
50-
"@autorest/powershell": "3.x"
5145

5246
directive:
5347
- from: swagger-document
@@ -91,7 +85,11 @@ directive:
9185

9286
- where:
9387
subject: ^CommunicationsGateway$|^CommunicationsContact$|^CommunicationsTestLine$
94-
variant: ^Create$|^CreateViaIdentity$|^CreateViaIdentityExpanded$|^Update$|^UpdateViaIdentity$
88+
variant: ^(Create|Update)(?!.*?(Expanded|JsonFilePath|JsonString))
89+
remove: true
90+
- where:
91+
subject: ^CommunicationsGateway$|^CommunicationsContact$|^CommunicationsTestLine$
92+
variant: ^CreateViaIdentity$|^CreateViaIdentityExpanded$
9593
remove: true
9694

9795
- where:
@@ -105,5 +103,6 @@ directive:
105103
set:
106104
parameter-name: FullContactName
107105
# - model-cmdlet:
108-
# - ServiceRegionProperties
106+
# - model-name: ServiceRegionProperties
107+
# cmdlet-name: New-AzVoiceServicesCommunicationsGatewayServiceRegionObject
109108
```

src/VoiceServices/VoiceServices.Autorest/custom/New-AzVoiceServicesCommunicationsGatewayServiceRegionObject.ps1

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,13 @@ Create an in-memory object for ServiceRegionProperties.
2121
Create an in-memory object for ServiceRegionProperties.
2222
2323
.Outputs
24-
Microsoft.Azure.PowerShell.Cmdlets.VoiceServices.Models.Api20230131.ServiceRegionProperties
24+
Microsoft.Azure.PowerShell.Cmdlets.VoiceServices.Models.ServiceRegionProperties
2525
.Link
2626
https://learn.microsoft.com/powershell/module/az.VoiceServices/new-AzVoiceServicesCommunicationsGatewayServiceRegionObject
2727
#>
2828
function New-AzVoiceServicesCommunicationsGatewayServiceRegionObject {
29-
[OutputType('Microsoft.Azure.PowerShell.Cmdlets.VoiceServices.Models.Api20230131.ServiceRegionProperties')]
29+
[Microsoft.Azure.PowerShell.Cmdlets.VoiceServices.ModelCmdletAttribute()]
30+
[OutputType('Microsoft.Azure.PowerShell.Cmdlets.VoiceServices.Models.ServiceRegionProperties')]
3031
[CmdletBinding(PositionalBinding=$false)]
3132
Param(
3233

@@ -42,7 +43,7 @@ function New-AzVoiceServicesCommunicationsGatewayServiceRegionObject {
4243
)
4344

4445
process {
45-
$Object = [Microsoft.Azure.PowerShell.Cmdlets.VoiceServices.Models.Api20230131.ServiceRegionProperties]::New()
46+
$Object = [Microsoft.Azure.PowerShell.Cmdlets.VoiceServices.Models.ServiceRegionProperties]::New()
4647

4748
if ($PSBoundParameters.ContainsKey('Name')) {
4849
$Object.Name = $Name

src/VoiceServices/VoiceServices.Autorest/docs/Az.VoiceServices.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
Module Name: Az.VoiceServices
3-
Module Guid: 2104c31d-8a79-4ea7-9485-2fe25d5c97be
3+
Module Guid: 8635872c-2777-4eac-8a7b-6c2b66691ee8
44
Download Help Link: https://learn.microsoft.com/powershell/module/az.voiceservices
55
Help Version: 1.0.0.0
66
Locale: en-US
@@ -18,13 +18,13 @@ Get a CommunicationsGateway
1818
Get a TestLine
1919

2020
### [New-AzVoiceServicesCommunicationsGateway](New-AzVoiceServicesCommunicationsGateway.md)
21-
Create a CommunicationsGateway
21+
create a CommunicationsGateway
2222

2323
### [New-AzVoiceServicesCommunicationsGatewayServiceRegionObject](New-AzVoiceServicesCommunicationsGatewayServiceRegionObject.md)
2424
Create an in-memory object for ServiceRegionProperties.
2525

2626
### [New-AzVoiceServicesCommunicationsTestLine](New-AzVoiceServicesCommunicationsTestLine.md)
27-
Create a TestLine
27+
create a TestLine
2828

2929
### [Remove-AzVoiceServicesCommunicationsGateway](Remove-AzVoiceServicesCommunicationsGateway.md)
3030
Delete a CommunicationsGateway
@@ -36,8 +36,8 @@ Delete a TestLine
3636
Check whether the resource name is available in the given region.
3737

3838
### [Update-AzVoiceServicesCommunicationsGateway](Update-AzVoiceServicesCommunicationsGateway.md)
39-
Update a CommunicationsGateway
39+
update a CommunicationsGateway
4040

4141
### [Update-AzVoiceServicesCommunicationsTestLine](Update-AzVoiceServicesCommunicationsTestLine.md)
42-
Update a TestLine
42+
update a TestLine
4343

src/VoiceServices/VoiceServices.Autorest/docs/Get-AzVoiceServicesCommunicationsGateway.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,6 @@ Accept wildcard characters: False
119119
120120
### -InputObject
121121
Identity Parameter
122-
To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
123122
124123
```yaml
125124
Type: Microsoft.Azure.PowerShell.Cmdlets.VoiceServices.Models.IVoiceServicesIdentity
@@ -188,7 +187,7 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
188187
189188
## OUTPUTS
190189
191-
### Microsoft.Azure.PowerShell.Cmdlets.VoiceServices.Models.Api20230131.ICommunicationsGateway
190+
### Microsoft.Azure.PowerShell.Cmdlets.VoiceServices.Models.ICommunicationsGateway
192191
193192
## NOTES
194193

src/VoiceServices/VoiceServices.Autorest/docs/Get-AzVoiceServicesCommunicationsTestLine.md

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

33+
### GetViaIdentityCommunicationsGateway
34+
```
35+
Get-AzVoiceServicesCommunicationsTestLine -CommunicationsGatewayInputObject <IVoiceServicesIdentity>
36+
-Name <String> [-DefaultProfile <PSObject>] [<CommonParameters>]
37+
```
38+
3339
## DESCRIPTION
3440
Get a TestLine
3541

@@ -76,6 +82,21 @@ Get a testline by pipeline.
7682

7783
## PARAMETERS
7884

85+
### -CommunicationsGatewayInputObject
86+
Identity Parameter
87+
88+
```yaml
89+
Type: Microsoft.Azure.PowerShell.Cmdlets.VoiceServices.Models.IVoiceServicesIdentity
90+
Parameter Sets: GetViaIdentityCommunicationsGateway
91+
Aliases:
92+
93+
Required: True
94+
Position: Named
95+
Default value: None
96+
Accept pipeline input: True (ByValue)
97+
Accept wildcard characters: False
98+
```
99+
79100
### -CommunicationsGatewayName
80101
Unique identifier for this deployment
81102
@@ -109,7 +130,6 @@ Accept wildcard characters: False
109130
110131
### -InputObject
111132
Identity Parameter
112-
To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
113133
114134
```yaml
115135
Type: Microsoft.Azure.PowerShell.Cmdlets.VoiceServices.Models.IVoiceServicesIdentity
@@ -128,7 +148,7 @@ Unique identifier for this test line
128148
129149
```yaml
130150
Type: System.String
131-
Parameter Sets: Get
151+
Parameter Sets: Get, GetViaIdentityCommunicationsGateway
132152
Aliases: TestLineName
133153

134154
Required: True
@@ -178,7 +198,7 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
178198
179199
## OUTPUTS
180200
181-
### Microsoft.Azure.PowerShell.Cmdlets.VoiceServices.Models.Api20230131.ITestLine
201+
### Microsoft.Azure.PowerShell.Cmdlets.VoiceServices.Models.ITestLine
182202
183203
## NOTES
184204

0 commit comments

Comments
 (0)