Skip to content

Commit 4bbb12f

Browse files
authored
[PS] Migrate MarketplaceOrdering module to autorest v4 (#27338)
1 parent 5d2aa45 commit 4bbb12f

19 files changed

+421
-71
lines changed
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 - MarketplaceOrdering")]
23+
[assembly: System.Reflection.AssemblyFileVersionAttribute("2.1.0")]
24+
[assembly: System.Reflection.AssemblyVersionAttribute("2.1.0")]
25+
[assembly: System.Runtime.InteropServices.ComVisibleAttribute(false)]
26+
[assembly: System.CLSCompliantAttribute(false)]

src/MarketplaceOrdering/MarketplaceOrdering.Autorest/README.md

+13-9
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,8 @@ input-file:
3535

3636
title: MarketplaceOrdering
3737
subject-prefix: Marketplace
38-
39-
identity-correction-for-post: true
40-
nested-object-to-string: true
4138
inlining-threshold: 50
4239

43-
# For new modules, please avoid setting 3.x using the use-extension method and instead, use 4.x as the default option
44-
use-extension:
45-
"@autorest/powershell": "3.x"
46-
4740
directive:
4841
- where:
4942
subject: MarketplaceAgreement
@@ -55,16 +48,27 @@ directive:
5548
set:
5649
subject: SignTerms
5750

51+
# The type 'SetAzMarketplaceTerms_CreateExpanded' already contains a definition for 'Publisher' and 'Product'
52+
# Customize create variant
53+
- where:
54+
subject: ^MarketplaceTerms$
55+
variant: ^Create(.*(JsonFilePath|JsonString))
56+
remove: true
5857
- where:
5958
subject: ^MarketplaceTerms$
60-
variant: ^CreateExpanded$|^CreateViaIdentity$|^CreateViaIdentityExpanded$
59+
variant: ^CreateExpanded$
60+
remove: true
61+
# Set cmdlet contains update verb.
62+
- where:
63+
verb: Update
64+
subject: MarketplaceTerms
6165
remove: true
6266

6367
# List response not mapp swagger define.
6468
- where:
6569
verb: Get
6670
subject: MarketplaceTerms
67-
variant: ^List$|^GetViaIdentity1$|^GetViaIdentity$
71+
variant: ^(?!Get$|Get1$)
6872
remove: true
6973

7074
# For map old cmdlet

src/MarketplaceOrdering/MarketplaceOrdering.Autorest/custom/Get-AzMarketplaceTerms.ps1

+3-3
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ INPUTOBJECT <IMarketplaceOrderingIdentity>: Identity Parameter
4444
https://learn.microsoft.com/powershell/module/az.marketplaceordering/get-azmarketplaceterms
4545
#>
4646
function Get-AzMarketplaceTerms {
47-
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementTerms])]
47+
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementTerms])]
4848
[CmdletBinding(DefaultParameterSetName='Get1', PositionalBinding=$false)]
4949
param(
5050
[Parameter(ParameterSetName='Get', Mandatory)]
@@ -70,8 +70,8 @@ param(
7070

7171
[Parameter(ParameterSetName='Get', Mandatory)]
7272
[Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Category('Path')]
73-
[ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Support.OfferType])]
74-
[Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Support.OfferType]
73+
[Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.PSArgumentCompleterAttribute("virtualmachine")]
74+
[System.String]
7575
# Publisher identifier string of image being deployed.
7676
${OfferType},
7777

src/MarketplaceOrdering/MarketplaceOrdering.Autorest/custom/Set-AzMarketplaceTerms.ps1

+2-2
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ PARAMETER <IAgreementTerms>: Terms properties for provided Publisher/Offer/Plan
5353
https://learn.microsoft.com/powershell/module/az.marketplaceordering/set-azmarketplaceterms
5454
#>
5555
function Set-AzMarketplaceTerms {
56-
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementTerms])]
56+
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementTerms])]
5757
[CmdletBinding(DefaultParameterSetName='TermsAccept', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
5858
param(
5959
[Parameter(Mandatory,ParameterSetName='TermsAccept')]
@@ -102,7 +102,7 @@ param(
102102
[Parameter(ParameterSetName='TermsAcceptViaIdentity', Mandatory, ValueFromPipeline)]
103103
[Parameter(ParameterSetName='TermsRejectViaIdentity', Mandatory, ValueFromPipeline)]
104104
[Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Category('Body')]
105-
[Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementTerms]
105+
[Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementTerms]
106106
# Terms properties for provided Publisher/Offer/Plan tuple
107107
# To construct, see NOTES section for PARAMETER properties and create a hash table.
108108
${Terms},

src/MarketplaceOrdering/MarketplaceOrdering.Autorest/docs/Az.MarketplaceOrdering.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
Module Name: Az.MarketplaceOrdering
3-
Module Guid: f781d2f9-c4c6-4d0b-bcfb-26973544c41d
3+
Module Guid: fe1b052f-8cbc-47f1-a3fb-428a015ab5ab
44
Download Help Link: https://learn.microsoft.com/powershell/module/az.marketplaceordering
55
Help Version: 1.0.0.0
66
Locale: en-US

src/MarketplaceOrdering/MarketplaceOrdering.Autorest/docs/Get-AzMarketplaceTerms.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Get-AzMarketplaceTerms -Name <String> -Product <String> -Publisher <String> [-Su
2020

2121
### Get
2222
```
23-
Get-AzMarketplaceTerms -Name <String> -OfferType <OfferType> -Product <String> -Publisher <String>
23+
Get-AzMarketplaceTerms -Name <String> -OfferType <String> -Product <String> -Publisher <String>
2424
[-SubscriptionId <String[]>] [-DefaultProfile <PSObject>] [<CommonParameters>]
2525
```
2626

@@ -91,7 +91,7 @@ Accept wildcard characters: False
9191
Publisher identifier string of image being deployed.
9292
9393
```yaml
94-
Type: Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Support.OfferType
94+
Type: System.String
9595
Parameter Sets: Get
9696
Aliases:
9797

@@ -156,7 +156,7 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
156156
157157
## OUTPUTS
158158
159-
### Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementTerms
159+
### Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementTerms
160160
161161
## NOTES
162162

src/MarketplaceOrdering/MarketplaceOrdering.Autorest/docs/Invoke-AzMarketplaceSignTerms.md

+45-4
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,18 @@ Invoke-AzMarketplaceSignTerms -InputObject <IMarketplaceOrderingIdentity> [-Defa
2424
[-Confirm] [-WhatIf] [<CommonParameters>]
2525
```
2626

27+
### SignViaIdentityAgreement
28+
```
29+
Invoke-AzMarketplaceSignTerms -AgreementInputObject <IMarketplaceOrderingIdentity> -Name <String>
30+
-Product <String> [-DefaultProfile <PSObject>] [-Confirm] [-WhatIf] [<CommonParameters>]
31+
```
32+
33+
### SignViaIdentityOffer
34+
```
35+
Invoke-AzMarketplaceSignTerms -Name <String> -OfferInputObject <IMarketplaceOrderingIdentity>
36+
[-DefaultProfile <PSObject>] [-Confirm] [-WhatIf] [<CommonParameters>]
37+
```
38+
2739
## DESCRIPTION
2840
Sign marketplace terms.
2941

@@ -57,6 +69,21 @@ This command signs marketplace terms by pipeline.
5769

5870
## PARAMETERS
5971

72+
### -AgreementInputObject
73+
Identity Parameter
74+
75+
```yaml
76+
Type: Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IMarketplaceOrderingIdentity
77+
Parameter Sets: SignViaIdentityAgreement
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+
6087
### -DefaultProfile
6188
The DefaultProfile parameter is not functional.
6289
Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.
@@ -75,7 +102,6 @@ Accept wildcard characters: False
75102
76103
### -InputObject
77104
Identity Parameter
78-
To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
79105
80106
```yaml
81107
Type: Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IMarketplaceOrderingIdentity
@@ -94,7 +120,7 @@ Plan identifier string of image being deployed.
94120
95121
```yaml
96122
Type: System.String
97-
Parameter Sets: Sign
123+
Parameter Sets: Sign, SignViaIdentityAgreement, SignViaIdentityOffer
98124
Aliases:
99125

100126
Required: True
@@ -104,12 +130,27 @@ Accept pipeline input: False
104130
Accept wildcard characters: False
105131
```
106132
133+
### -OfferInputObject
134+
Identity Parameter
135+
136+
```yaml
137+
Type: Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IMarketplaceOrderingIdentity
138+
Parameter Sets: SignViaIdentityOffer
139+
Aliases:
140+
141+
Required: True
142+
Position: Named
143+
Default value: None
144+
Accept pipeline input: True (ByValue)
145+
Accept wildcard characters: False
146+
```
147+
107148
### -Product
108149
Offer identifier string of image being deployed.
109150
110151
```yaml
111152
Type: System.String
112-
Parameter Sets: Sign
153+
Parameter Sets: Sign, SignViaIdentityAgreement
113154
Aliases:
114155

115156
Required: True
@@ -189,7 +230,7 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
189230
190231
## OUTPUTS
191232
192-
### Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementTerms
233+
### Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementTerms
193234
194235
## NOTES
195236

src/MarketplaceOrdering/MarketplaceOrdering.Autorest/docs/Set-AzMarketplaceTerms.md

+3-4
Original file line numberDiff line numberDiff line change
@@ -203,10 +203,9 @@ Accept wildcard characters: False
203203
### -Terms
204204
Terms properties for provided Publisher/Offer/Plan tuple
205205
To construct, see NOTES section for PARAMETER properties and create a hash table.
206-
To construct, see NOTES section for TERMS properties and create a hash table.
207206
208207
```yaml
209-
Type: Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementTerms
208+
Type: Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementTerms
210209
Parameter Sets: TermsAcceptViaIdentity, TermsRejectViaIdentity
211210
Aliases:
212211

@@ -253,11 +252,11 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
253252
254253
## INPUTS
255254
256-
### Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementTerms
255+
### Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementTerms
257256
258257
## OUTPUTS
259258
260-
### Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementTerms
259+
### Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementTerms
261260
262261
## NOTES
263262

src/MarketplaceOrdering/MarketplaceOrdering.Autorest/docs/Stop-AzMarketplaceTerms.md

+45-4
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,18 @@ Stop-AzMarketplaceTerms -InputObject <IMarketplaceOrderingIdentity> [-DefaultPro
2424
[-WhatIf] [<CommonParameters>]
2525
```
2626

27+
### CancelViaIdentityAgreement
28+
```
29+
Stop-AzMarketplaceTerms -AgreementInputObject <IMarketplaceOrderingIdentity> -Name <String> -Product <String>
30+
[-DefaultProfile <PSObject>] [-Confirm] [-WhatIf] [<CommonParameters>]
31+
```
32+
33+
### CancelViaIdentityOffer
34+
```
35+
Stop-AzMarketplaceTerms -Name <String> -OfferInputObject <IMarketplaceOrderingIdentity>
36+
[-DefaultProfile <PSObject>] [-Confirm] [-WhatIf] [<CommonParameters>]
37+
```
38+
2739
## DESCRIPTION
2840
Cancel marketplace terms.
2941

@@ -57,6 +69,21 @@ This command cancel marketplace terms by pipeline.
5769

5870
## PARAMETERS
5971

72+
### -AgreementInputObject
73+
Identity Parameter
74+
75+
```yaml
76+
Type: Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IMarketplaceOrderingIdentity
77+
Parameter Sets: CancelViaIdentityAgreement
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+
6087
### -DefaultProfile
6188
The DefaultProfile parameter is not functional.
6289
Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.
@@ -75,7 +102,6 @@ Accept wildcard characters: False
75102
76103
### -InputObject
77104
Identity Parameter
78-
To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
79105
80106
```yaml
81107
Type: Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IMarketplaceOrderingIdentity
@@ -94,7 +120,7 @@ Plan identifier string of image being deployed.
94120
95121
```yaml
96122
Type: System.String
97-
Parameter Sets: Cancel
123+
Parameter Sets: Cancel, CancelViaIdentityAgreement, CancelViaIdentityOffer
98124
Aliases:
99125

100126
Required: True
@@ -104,12 +130,27 @@ Accept pipeline input: False
104130
Accept wildcard characters: False
105131
```
106132
133+
### -OfferInputObject
134+
Identity Parameter
135+
136+
```yaml
137+
Type: Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IMarketplaceOrderingIdentity
138+
Parameter Sets: CancelViaIdentityOffer
139+
Aliases:
140+
141+
Required: True
142+
Position: Named
143+
Default value: None
144+
Accept pipeline input: True (ByValue)
145+
Accept wildcard characters: False
146+
```
147+
107148
### -Product
108149
Offer identifier string of image being deployed.
109150
110151
```yaml
111152
Type: System.String
112-
Parameter Sets: Cancel
153+
Parameter Sets: Cancel, CancelViaIdentityAgreement
113154
Aliases:
114155

115156
Required: True
@@ -189,7 +230,7 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
189230
190231
## OUTPUTS
191232
192-
### Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementTerms
233+
### Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementTerms
193234
194235
## NOTES
195236
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"generate_Id": "b631a59e-9829-47e1-8d97-389622e100c5"
2+
"generate_Id": "23545fce-cf16-4d10-b303-962956c5b572"
33
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Resources
2+
This directory can contain any additional resources for module that are not required at runtime. This directory **does not** get packaged with the module. If you have assets for custom implementation, place them into the `..\custom` folder.
3+
4+
## Info
5+
- Modifiable: yes
6+
- Generated: no
7+
- Committed: yes
8+
- Packaged: no
9+
10+
## Purpose
11+
Use this folder to put anything you want to keep around as part of the repository for the module, but is not something that is required for the module. For example, development files, packaged builds, or additional information. This is only intended to be used in repositories where the module's output directory is cleaned, but tangential resources for the module want to remain intact.

0 commit comments

Comments
 (0)