Skip to content

Commit c3604ec

Browse files
YanaXugrhuangmsftshreyakumar3093wyunchi-ms
authored
[Az.Support] generate Az.Support with autorest (Azure#24843)
* init add powershell cmdlet * add customization for filedetails * correct readme to include file workspace create * add custom cmdlet for creating and uploading the file * chunking logic for larger files * add error for custom cmdlet when file too big * combined cmdlets * edit custom file upload command to not use default subscriptionid * no default value for subid in custom file upload * separate subscription and no subscription commands * remove comments from combined cmd for file * fix cmd * custom no subscription file upload commands * autogen docs for no sub file upload * hide individual file commands * add back workspace commands * add name as alias for fileworkspacename fileworkspacesnosubscription * remove update files and add alias for nosubscription file commands * tests for get service * tests for problem classification * try adding erroractionpreference = stop * tests for new file workspace * tests for get file workspace * more tests * add tests for new file and upload, removefile name as a parameter * remove new files no subscription * tests for get file * erroraction stop * remove unnecessary comments and print statements * docs for get support service * problem classification docs * add titles * documentation for file workspace commands * documentation for file/file workspace cmdlets * documentation for checkNameAvailability * added tests and documentation for operations, support ticket, communication and chat transcript cmdlets * added examples for operations, support ticket, communication and chat transcript cmdlets * resolve merge conflicts * resolved PR comments * get conflict file changes from grhuang/azsupport-autorest * resolved merge conflict * removed update communication sub and no sub scenarios * Revert "removed update communication sub and no sub scenarios" This reverts commit ccbfdee. * removed update communication sub and no sub scenarios , updated readme * make communiation and support ticket properties required in readme, edit get operation file name, edit calling internal cmdlets for file upload * fix documentation * fix top query * add custom error handler * consolidate list and get communicationsnosubscription and chattranscriptsnosubscription * init changes to allow no subscription recording tests-need to use csp partner account in tenant 2e6a0c9f-986d-480e-ad4b-bdfddc047aba * changes to not create new resources in playback * remove custom error handler csharp * init add changes to split subscription and no subscription tests * update skip * Update recordings * update recordings * add more examples to new-azsupportticket documentation * update documentation and readme * add directive back in * make advanced diagnostic consent required * Add custom error handling for New- and Update- cmdlets to print full details of error (#9) * Add custom error handler * Add default filter to retrieve tickets from the past week for Get-AzSupportTickets and Get-AzSupportTicketsNoSubscription (#10) * add custom filtering for list support ticket if no filter is applied * make transformations in swagger in readme to make enrollment id not readonly and show isTempTicket (#11) * Add argument completer (#12) * add argument completers * add quotes to argument completers * remove repeated time zone * Regenerate powershell module with GA swagger (#13) * Rerecord tests using GA version (#14) * add tests for file size (will add recordings once Ga swagger available) * Regenerate powershell module with GA swagger * Rerecord tests with GA version * Fix documentation * fix url for file upload --------- Co-authored-by: Grace Huang (from Dev Box) <[email protected]> Co-authored-by: grhuangmsft <[email protected]> Co-authored-by: Shreya Kumar <[email protected]> Co-authored-by: Yunchi Wang <[email protected]>
1 parent 23eee73 commit c3604ec

File tree

157 files changed

+14155
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

157 files changed

+14155
-0
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* text=auto
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
bin
2+
obj
3+
.vs
4+
generated
5+
internal
6+
exports
7+
tools
8+
custom/*.psm1
9+
custom/autogen-model-cmdlets
10+
test/*-TestResults.xml
11+
/*.ps1
12+
/*.ps1xml
13+
/*.psm1
14+
/*.snk
15+
/*.csproj
16+
/*.nuspec
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
@{
2+
GUID = 'ca38d4b0-fe38-4f55-b9e1-66df3d985f20'
3+
RootModule = './Az.Support.psm1'
4+
ModuleVersion = '0.1.0'
5+
CompatiblePSEditions = 'Core', 'Desktop'
6+
Author = 'Microsoft Corporation'
7+
CompanyName = 'Microsoft Corporation'
8+
Copyright = 'Microsoft Corporation. All rights reserved.'
9+
Description = 'Microsoft Azure PowerShell: Support cmdlets'
10+
PowerShellVersion = '5.1'
11+
DotNetFrameworkVersion = '4.7.2'
12+
RequiredAssemblies = './bin/Az.Support.private.dll'
13+
FormatsToProcess = './Az.Support.format.ps1xml'
14+
FunctionsToExport = 'Get-AzSupportChatTranscript', 'Get-AzSupportChatTranscriptsNoSubscription', 'Get-AzSupportCommunication', 'Get-AzSupportCommunicationsNoSubscription', 'Get-AzSupportFile', 'Get-AzSupportFilesNoSubscription', 'Get-AzSupportFileWorkspace', 'Get-AzSupportFileWorkspacesNoSubscription', 'Get-AzSupportOperation', 'Get-AzSupportProblemClassification', 'Get-AzSupportService', 'Get-AzSupportTicket', 'Get-AzSupportTicketsNoSubscription', 'New-AzSupportCommunication', 'New-AzSupportCommunicationsNoSubscription', 'New-AzSupportFileAndUpload', 'New-AzSupportFileAndUploadNoSubscription', 'New-AzSupportFileWorkspace', 'New-AzSupportFileWorkspacesNoSubscription', 'New-AzSupportTicket', 'New-AzSupportTicketsNoSubscription', 'Test-AzSupportCommunicationNameAvailability', 'Test-AzSupportCommunicationsNoSubscriptionNameAvailability', 'Test-AzSupportTicketNameAvailability', 'Test-AzSupportTicketsNoSubscriptionNameAvailability', 'Update-AzSupportTicket', 'Update-AzSupportTicketsNoSubscription'
15+
PrivateData = @{
16+
PSData = @{
17+
Tags = 'Azure', 'ResourceManager', 'ARM', 'PSModule', 'Support'
18+
LicenseUri = 'https://aka.ms/azps-license'
19+
ProjectUri = 'https://github.com/Azure/azure-powershell'
20+
ReleaseNotes = ''
21+
}
22+
}
23+
}
Lines changed: 234 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,234 @@
1+
<!-- region Generated -->
2+
# Az.Support
3+
This directory contains the PowerShell module for the Support service.
4+
5+
---
6+
## Status
7+
[![Az.Support](https://img.shields.io/powershellgallery/v/Az.Support.svg?style=flat-square&label=Az.Support "Az.Support")](https://www.powershellgallery.com/packages/Az.Support/)
8+
9+
## Info
10+
- Modifiable: yes
11+
- Generated: all
12+
- Committed: yes
13+
- Packaged: yes
14+
15+
---
16+
## Detail
17+
This module was primarily generated via [AutoRest](https://github.com/Azure/autorest) using the [PowerShell](https://github.com/Azure/autorest.powershell) extension.
18+
19+
## Module Requirements
20+
- [Az.Accounts module](https://www.powershellgallery.com/packages/Az.Accounts/), version 2.7.5 or greater
21+
22+
## Authentication
23+
AutoRest does not generate authentication code for the module. Authentication is handled via Az.Accounts by altering the HTTP payload before it is sent.
24+
25+
## Development
26+
For information on how to develop for `Az.Support`, see [how-to.md](how-to.md).
27+
<!-- endregion -->
28+
29+
### AutoRest Configuration
30+
> see https://aka.ms/autorest
31+
32+
```yaml
33+
# pin the swagger version by using the commit id instead of branch name
34+
commit: 791ef5476e10bb15ab9ad46e2c2d8835ac24ac24
35+
require:
36+
# readme.azure.noprofile.md is the common configuration file
37+
- $(this-folder)/../../readme.azure.noprofile.md
38+
# If the swagger has not been put in the repo, you may uncomment the following line and refer to it locally
39+
# - (this-folder)/relative-path-to-your-local-readme.md
40+
input-file:
41+
- $(repo)/specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/support.json
42+
43+
# For new RP, the version is 0.1.0
44+
module-version: 0.1.0
45+
# Normally, title is the service name
46+
title: Support
47+
subject-prefix: $(service-name)
48+
49+
# The next three configurations are exclusive to v3, and in v4, they are activated by default. If you are still using v3, please uncomment them.
50+
# identity-correction-for-post: true
51+
# resourcegroup-append: true
52+
# nested-object-to-string: true
53+
54+
directive:
55+
- where:
56+
model-name: ProblemClassification
57+
set:
58+
format-table:
59+
properties:
60+
- DisplayName
61+
- Name
62+
- SecondaryConsentEnabled
63+
- where:
64+
model-name: Service
65+
set:
66+
format-table:
67+
properties:
68+
- DisplayName
69+
- Name
70+
- ResourceType
71+
- where:
72+
model-name: FileDetails
73+
set:
74+
format-table:
75+
properties:
76+
- Name
77+
- CreatedOn
78+
- ChunkSize
79+
- FileSize
80+
- NumberOfChunks
81+
- where:
82+
model-name: SupportTicketDetails
83+
set:
84+
format-table:
85+
properties:
86+
- Name
87+
- Title
88+
- SupportTicketId
89+
- Severity
90+
- ServiceDisplayName
91+
- CreatedDate
92+
- where:
93+
model-name: CommunicationDetails
94+
set:
95+
format-table:
96+
properties:
97+
- Name
98+
- Sender
99+
- Subject
100+
- CreatedDate
101+
- where:
102+
model-name: ChatTranscriptDetails
103+
set:
104+
format-table:
105+
properties:
106+
- Name
107+
- StartTime
108+
- where:
109+
subject: CommunicationsNoSubscription
110+
parameter-name: CommunicationName
111+
set:
112+
alias: Name
113+
- where:
114+
subject: SupportTicketsNoSubscription
115+
parameter-name: SupportTicketName
116+
set:
117+
alias: Name
118+
- where:
119+
subject: ChatTranscriptsNoSubscription
120+
parameter-name: ChatTranscriptName
121+
set:
122+
alias: Name
123+
- where:
124+
subject: UploadFile
125+
parameter-name: FileWorkspaceName
126+
set:
127+
alias: WorkspaceName
128+
- where:
129+
subject: UploadFilesNoSubscription
130+
parameter-name: FileWorkspaceName
131+
set:
132+
alias: WorkspaceName
133+
- where:
134+
subject: FileWorkspacesNoSubscription
135+
parameter-name: FileWorkspaceName
136+
set:
137+
alias: Name
138+
- where:
139+
subject: FilesNoSubscription
140+
parameter-name: FileName
141+
set:
142+
alias: Name
143+
- where:
144+
subject: FilesNoSubscription
145+
parameter-name: FileWorkspaceName
146+
set:
147+
alias: WorkspaceName
148+
- where:
149+
parameter-name: ContactDetailPreferredTimeZone
150+
set:
151+
completer:
152+
name: Time Zone Completer
153+
description: Gets the list of valid time zones
154+
script: "'\"Afghanistan Standard Time\"', '\"Alaskan Standard Time\"', '\"Arab Standard Time\"', '\"Arabian Standard Time\"', '\"Arabic Standard Time\"', '\"Argentina Standard Time\"', '\"Atlantic Standard Time\"', '\"AUS Central Standard Time\"', '\"AUS Eastern Standard Time\"', '\"Azerbaijan Standard Time\"', '\"Azores Standard Time\"','\"Canada Central Standard Time\"','\"Cape Verde Standard Time\"','\"Caucasus Standard Time\"','\"Cen. Australia Standard Time\"','\"Central America Standard Time\"','\"Central Asia Standard Time\"','\"Central Brazilian Standard Time\"','\"Central Europe Standard Time\"','\"Central European Standard Time\"','\"Central Pacific Standard Time\"','\"Central Standard Time\"','\"Central Standard Time (Mexico)\"','\"China Standard Time\"','\"Dateline Standard Time\"','\"E. Africa Standard Time\"','\"E. Australia Standard Time\"','\"E. Europe Standard Time\"','\"E. South America Standard Time\"','\"Eastern Standard Time\"','\"Eastern Standard Time (Mexico)\"','\"Egypt Standard Time\"','\"Ekaterinburg Standard Time\"','\"Fiji Standard Time\"','\"FLE Standard Time\"','\"Georgian Standard Time\"','\"GMT Standard Time\"','\"Greenland Standard Time\"','\"Greenwich Standard Time\"','\"GTB Standard Time\"','\"Hawaiian Standard Time\"','\"India Standard Time\"','\"Iran Standard Time\"','\"Israel Standard Time\"','\"Jordan Standard Time\"','\"Korea Standard Time\"','\"Mauritius Standard Time\"','\"Mid-Atlantic Standard Time\"','\"Middle East Standard Time\"','\"Montevideo Standard Time\"','\"Morocco Standard Time\"','\"Mountain Standard Time\"','\"Mountain Standard Time (Mexico)\"','\"Myanmar Standard Time\"','\"N. Central Asia Standard Time\"','\"Namibia Standard Time\"','\"Nepal Standard Time\"','\"New Zealand Standard Time\"','\"Newfoundland Standard Time\"','\"North Asia East Standard Time\"','\"North Asia Standard Time\"','\"Pacific SA Standard Time\"','\"Pacific Standard Time\"','\"Pacific Standard Time (Mexico)\"','\"Pakistan Standard Time\"','\"Romance Standard Time\"','\"Russian Standard Time\"','\"SA Eastern Standard Time\"','\"SA Pacific Standard Time\"','\"SA Western Standard Time\"','\"Samoa Standard Time\"','\"SE Asia Standard Time\"','\"Singapore Standard Time\"','\"South Africa Standard Time\"','\"Sri Lanka Standard Time\"','\"Taipei Standard Time\"','\"Tasmania Standard Time\"','\"Tokyo Standard Time\"','\"Tonga Standard Time\"','\"Turkey Standard Time\"','\"US Eastern Standard Time\"','\"US Mountain Standard Time\"','\"UTC\"','\"Venezuela Standard Time\"','\"Vladivostok Standard Time\"','\"W. Australia Standard Time\"','\"W. Central Africa Standard Time\"','\"W. Europe Standard Time\"','\"West Asia Standard Time\"','\"West Pacific Standard Time\"','\"Yakutsk Standard Time\"'"
155+
- where:
156+
parameter-name: ContactDetailPreferredSupportLanguage
157+
set:
158+
completer:
159+
name: Support Language Completer
160+
description: Gets the list of valid support languages
161+
script: "'\"en-us\"','\"es-es\"','\"fr-fr\"','\"de-de\"','\"it-it\"','\"ja-jp\"','\"ko-kr\"','\"ru-ru\"','\"pt-br\"','\"zh-tw\"','\"zh-hans\"'"
162+
- where:
163+
verb: New
164+
subject: File
165+
hide: true
166+
- where:
167+
verb: New
168+
subject: FilesNoSubscription
169+
hide: true
170+
- where:
171+
verb: Get
172+
subject: SupportTicket
173+
hide: true
174+
- where:
175+
verb: Get
176+
subject: SupportTicketsNoSubscription
177+
hide: true
178+
- where:
179+
verb: Update
180+
subject: File
181+
remove: true
182+
- where:
183+
verb: Update
184+
subject: FilesNoSubscription
185+
remove: true
186+
- where:
187+
verb: Invoke
188+
subject: UploadFile
189+
hide: true
190+
- where:
191+
verb: Invoke
192+
subject: UploadFilesNoSubscription
193+
hide: true
194+
- where:
195+
verb: Update
196+
subject: Communication
197+
remove: true
198+
- where:
199+
verb: Update
200+
subject: CommunicationsNoSubscription
201+
remove: true
202+
- from: GetAzSupportTicket_List.cs
203+
where: $
204+
transform: $ = $.replace("!String.IsNullOrEmpty(_nextLink)" ,"!String.IsNullOrEmpty(_nextLink) && this._top <= 0");
205+
- from: GetAzSupportTicketsNoSubscription_List.cs
206+
where: $
207+
transform: $ = $.replace("!String.IsNullOrEmpty(_nextLink)" ,"!String.IsNullOrEmpty(_nextLink) && this._top <= 0");
208+
- from: GetAzSupportCommunication_List.cs
209+
where: $
210+
transform: $ = $.replace("!String.IsNullOrEmpty(_nextLink)" ,"!String.IsNullOrEmpty(_nextLink) && this._top <= 0");
211+
- from: GetAzSupportCommunicationsNoSubscription_List.cs
212+
where: $
213+
transform: $ = $.replace("!String.IsNullOrEmpty(_nextLink)" ,"!String.IsNullOrEmpty(_nextLink) && this._top <= 0");
214+
# Following are common directives which are normally required in all the RPs
215+
# 1. Remove the unexpanded parameter set
216+
# 2. For New-* cmdlets, ViaIdentity is not required
217+
# Following two directives are v4 specific
218+
- where:
219+
variant: ^(Create|Update)(?!.*?Expanded|JsonFilePath|JsonString)
220+
subject: ^(?!FileWorkspace|FileWorkspacesNoSubscription$).*
221+
remove: true
222+
- where:
223+
variant: ^CreateViaIdentity.*$
224+
remove: true
225+
# Follow directive is v3 specific. If you are using v3, uncomment following directive and comments out two directives above
226+
#- where:
227+
# variant: ^Create$|^CreateViaIdentity$|^CreateViaIdentityExpanded$|^Update$|^UpdateViaIdentity$
228+
# remove: true
229+
230+
# Remove the set-* cmdlet
231+
# - where:
232+
# verb: Set
233+
# remove: true
234+
```
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
{
2+
"resourceType": "fileWorkspaces/files",
3+
"apiVersion": "2024-04-01",
4+
"learnMore": {
5+
"url": "https://learn.microsoft.com/powershell/module/az.support"
6+
},
7+
"commands": [
8+
{
9+
"name": "Get-AzSupportFilesNoSubscription",
10+
"description": "Returns details of a specific file in a work space.",
11+
"path": "/providers/Microsoft.Support/fileWorkspaces/{fileWorkspaceName}/files/{fileName}",
12+
"help": {
13+
"learnMore": {
14+
"url": "https://learn.microsoft.com/powershell/module/az.support/get-azsupportfilesnosubscription"
15+
},
16+
"parameterSets": [
17+
{
18+
"parameters": [
19+
"-FileName <String>",
20+
"-FileWorkspaceName <String>"
21+
]
22+
}
23+
]
24+
},
25+
"examples": [
26+
{
27+
"description": "Returns details of a specific file in a work space.",
28+
"parameters": [
29+
{
30+
"name": "-FileName",
31+
"value": "[Path.fileName]"
32+
},
33+
{
34+
"name": "-FileWorkspaceName",
35+
"value": "[Path.fileWorkspaceName]"
36+
}
37+
]
38+
}
39+
]
40+
},
41+
{
42+
"name": "Get-AzSupportFile",
43+
"description": "Returns details of a specific file in a work space.",
44+
"path": "/subscriptions/{subscriptionId}/providers/Microsoft.Support/fileWorkspaces/{fileWorkspaceName}/files/{fileName}",
45+
"help": {
46+
"learnMore": {
47+
"url": "https://learn.microsoft.com/powershell/module/az.support/get-azsupportfile"
48+
},
49+
"parameterSets": [
50+
{
51+
"parameters": [
52+
"-Name <String>",
53+
"[-SubscriptionId <String[]>]",
54+
"-WorkspaceName <String>"
55+
]
56+
}
57+
]
58+
},
59+
"examples": [
60+
{
61+
"description": "Returns details of a specific file in a work space.",
62+
"parameters": [
63+
{
64+
"name": "-Name",
65+
"value": "[Path.fileName]"
66+
},
67+
{
68+
"name": "-SubscriptionId",
69+
"value": "[Path.subscriptionId]"
70+
},
71+
{
72+
"name": "-WorkspaceName",
73+
"value": "[Path.fileWorkspaceName]"
74+
}
75+
]
76+
}
77+
]
78+
}
79+
]
80+
}

0 commit comments

Comments
 (0)