Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Az.Support] generate Az.Support with autorest #24843

Merged
merged 78 commits into from
May 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
78 commits
Select commit Hold shift + click to select a range
cf8e4ac
init add powershell cmdlet
grhuangmsft Dec 1, 2023
6a3baa3
add customization for filedetails
grhuangmsft Dec 18, 2023
1b15859
correct readme to include file workspace create
grhuangmsft Jan 11, 2024
c2e620c
add custom cmdlet for creating and uploading the file
grhuangmsft Jan 12, 2024
e2cc76e
chunking logic for larger files
grhuangmsft Jan 17, 2024
07ace3d
add error for custom cmdlet when file too big
grhuangmsft Jan 19, 2024
69b3443
combined cmdlets
grhuangmsft Jan 19, 2024
f414931
edit custom file upload command to not use default subscriptionid
grhuangmsft Jan 19, 2024
a7546e4
no default value for subid in custom file upload
grhuangmsft Jan 19, 2024
1f7f741
separate subscription and no subscription commands
grhuangmsft Jan 23, 2024
a22e254
remove comments from combined cmd for file
grhuangmsft Jan 23, 2024
5dea32a
fix cmd
grhuangmsft Jan 23, 2024
a5b213d
custom no subscription file upload commands
grhuangmsft Jan 23, 2024
b953811
autogen docs for no sub file upload
grhuangmsft Jan 23, 2024
276498c
hide individual file commands
grhuangmsft Jan 23, 2024
487bef6
add back workspace commands
grhuangmsft Jan 23, 2024
ef75f6b
add name as alias for fileworkspacename fileworkspacesnosubscription
grhuangmsft Jan 24, 2024
ec6d597
remove update files and add alias for nosubscription file commands
grhuangmsft Jan 24, 2024
9715b15
tests for get service
grhuangmsft Jan 26, 2024
b1b98b7
tests for problem classification
grhuangmsft Jan 26, 2024
d19fb89
try adding erroractionpreference = stop
grhuangmsft Jan 29, 2024
1d8bed2
tests for new file workspace
grhuangmsft Jan 29, 2024
41e373b
tests for get file workspace
grhuangmsft Jan 30, 2024
f41fe6c
more tests
grhuangmsft Jan 30, 2024
1313bdc
add tests for new file and upload, removefile name as a parameter
grhuangmsft Jan 31, 2024
5332d08
remove new files no subscription
grhuangmsft Jan 31, 2024
683579a
tests for get file
grhuangmsft Jan 31, 2024
f4e7b8e
erroraction stop
grhuangmsft Feb 1, 2024
60b7341
remove unnecessary comments and print statements
grhuangmsft Feb 1, 2024
7bdc9aa
Merge pull request #1 from grhuangmsft/users/grhuang/azsupport-autore…
grhuangmsft Feb 6, 2024
913b1bb
docs for get support service
grhuangmsft Feb 7, 2024
452e2d0
problem classification docs
grhuangmsft Feb 7, 2024
54c1f1d
add titles
grhuangmsft Feb 7, 2024
5878a49
documentation for file workspace commands
grhuangmsft Feb 8, 2024
c41fec4
documentation for file/file workspace cmdlets
grhuangmsft Feb 9, 2024
3851a1d
documentation for checkNameAvailability
grhuangmsft Feb 13, 2024
762b446
Merge pull request #2 from grhuangmsft/users/grhuang/azsupport-autore…
grhuangmsft Feb 16, 2024
79208ba
added tests and documentation for operations, support ticket, communi…
shreyakumar3093 Feb 22, 2024
6bcf34e
added examples for operations, support ticket, communication and chat…
shreyakumar3093 Feb 22, 2024
7ddff6c
resolve merge conflicts
shreyakumar3093 Feb 22, 2024
39253ec
resolved PR comments
shreyakumar3093 Feb 23, 2024
3bad989
get conflict file changes from grhuang/azsupport-autorest
shreyakumar3093 Feb 23, 2024
0d18131
Merge branch 'users/grhuang/azsupport-autorest' into users/shreyakuma…
shreyakumar3093 Feb 23, 2024
b59b1ff
resolved merge conflict
shreyakumar3093 Feb 23, 2024
ccbfdee
removed update communication sub and no sub scenarios
shreyakumar3093 Feb 23, 2024
1a32d3b
Revert "removed update communication sub and no sub scenarios"
shreyakumar3093 Feb 23, 2024
1a21b88
removed update communication sub and no sub scenarios , updated readme
shreyakumar3093 Feb 23, 2024
de3fcf5
Merge pull request #4 from shreyakumar3093/users/shreyakumar/grhuang/…
grhuangmsft Feb 26, 2024
194a139
make communiation and support ticket properties required in readme, e…
grhuangmsft Mar 5, 2024
4f79e30
fix documentation
grhuangmsft Mar 5, 2024
cc100ad
fix top query
grhuangmsft Mar 5, 2024
8a00ab3
add custom error handler
grhuangmsft Mar 6, 2024
962bda3
consolidate list and get communicationsnosubscription and chattranscr…
grhuangmsft Mar 6, 2024
eec230e
init changes to allow no subscription recording tests-need to use csp…
grhuangmsft Mar 7, 2024
7643b1c
changes to not create new resources in playback
grhuangmsft Mar 7, 2024
ef100cc
remove custom error handler csharp
grhuangmsft Mar 7, 2024
da3c0a6
Merge pull request #5 from grhuangmsft/users/grhuang/azsupport-autore…
grhuangmsft Mar 7, 2024
68944c1
Merge branch 'users/grhuang/azsupport-autorest' into users/grhuang/up…
grhuangmsft Mar 7, 2024
d953d52
init add changes to split subscription and no subscription tests
grhuangmsft Mar 7, 2024
d7835cf
update skip
grhuangmsft Mar 7, 2024
ff79587
Update recordings
grhuangmsft Mar 8, 2024
2362e86
update recordings
grhuangmsft Mar 8, 2024
06323ee
add more examples to new-azsupportticket documentation
grhuangmsft Mar 8, 2024
4f2e4bc
update documentation and readme
grhuangmsft Mar 11, 2024
862ddd7
add directive back in
grhuangmsft Mar 11, 2024
4600eba
make advanced diagnostic consent required
grhuangmsft Mar 12, 2024
1e7f414
Merge pull request #8 from grhuangmsft/users/grhuang/documentation-an…
grhuangmsft Mar 12, 2024
8e5227f
Merge pull request #6 from grhuangmsft/users/grhuang/update-tests
grhuangmsft Mar 14, 2024
615e1c5
Add custom error handling for New- and Update- cmdlets to print full …
grhuangmsft Mar 15, 2024
112512e
Add default filter to retrieve tickets from the past week for Get-AzS…
grhuangmsft Mar 15, 2024
9e778f0
make transformations in swagger in readme to make enrollment id not r…
grhuangmsft Mar 19, 2024
c6b7740
Add argument completer (#12)
grhuangmsft Mar 22, 2024
6f2684b
Regenerate powershell module with GA swagger (#13)
grhuangmsft Apr 25, 2024
5363e1e
Rerecord tests using GA version (#14)
grhuangmsft Apr 25, 2024
13e2423
Fix documentation
grhuangmsft Apr 26, 2024
08806a0
fix url for file upload
grhuangmsft Apr 29, 2024
1585cd3
Merge pull request #24794 from grhuangmsft/grhuang/support-autorest
YanaXu May 6, 2024
f70469f
Merge branch 'generation' of https://github.com/Azure/azure-powershel…
wyunchi-ms May 7, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/Support/Support.Autorest/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* text=auto
16 changes: 16 additions & 0 deletions src/Support/Support.Autorest/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
bin
obj
.vs
generated
internal
exports
tools
custom/*.psm1
custom/autogen-model-cmdlets
test/*-TestResults.xml
/*.ps1
/*.ps1xml
/*.psm1
/*.snk
/*.csproj
/*.nuspec
23 changes: 23 additions & 0 deletions src/Support/Support.Autorest/Az.Support.psd1
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
@{
GUID = 'ca38d4b0-fe38-4f55-b9e1-66df3d985f20'
RootModule = './Az.Support.psm1'
ModuleVersion = '0.1.0'
CompatiblePSEditions = 'Core', 'Desktop'
Author = 'Microsoft Corporation'
CompanyName = 'Microsoft Corporation'
Copyright = 'Microsoft Corporation. All rights reserved.'
Description = 'Microsoft Azure PowerShell: Support cmdlets'
PowerShellVersion = '5.1'
DotNetFrameworkVersion = '4.7.2'
RequiredAssemblies = './bin/Az.Support.private.dll'
FormatsToProcess = './Az.Support.format.ps1xml'
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'
PrivateData = @{
PSData = @{
Tags = 'Azure', 'ResourceManager', 'ARM', 'PSModule', 'Support'
LicenseUri = 'https://aka.ms/azps-license'
ProjectUri = 'https://github.com/Azure/azure-powershell'
ReleaseNotes = ''
}
}
}
234 changes: 234 additions & 0 deletions src/Support/Support.Autorest/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,234 @@
<!-- region Generated -->
# Az.Support
This directory contains the PowerShell module for the Support service.

---
## Status
[![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/)

## Info
- Modifiable: yes
- Generated: all
- Committed: yes
- Packaged: yes

---
## Detail
This module was primarily generated via [AutoRest](https://github.com/Azure/autorest) using the [PowerShell](https://github.com/Azure/autorest.powershell) extension.

## Module Requirements
- [Az.Accounts module](https://www.powershellgallery.com/packages/Az.Accounts/), version 2.7.5 or greater

## Authentication
AutoRest does not generate authentication code for the module. Authentication is handled via Az.Accounts by altering the HTTP payload before it is sent.

## Development
For information on how to develop for `Az.Support`, see [how-to.md](how-to.md).
<!-- endregion -->

### AutoRest Configuration
> see https://aka.ms/autorest

```yaml
# pin the swagger version by using the commit id instead of branch name
commit: 791ef5476e10bb15ab9ad46e2c2d8835ac24ac24
require:
# readme.azure.noprofile.md is the common configuration file
- $(this-folder)/../../readme.azure.noprofile.md
# If the swagger has not been put in the repo, you may uncomment the following line and refer to it locally
# - (this-folder)/relative-path-to-your-local-readme.md
input-file:
- $(repo)/specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/support.json

# For new RP, the version is 0.1.0
module-version: 0.1.0
# Normally, title is the service name
title: Support
subject-prefix: $(service-name)

# 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.
# identity-correction-for-post: true
# resourcegroup-append: true
# nested-object-to-string: true

directive:
- where:
model-name: ProblemClassification
set:
format-table:
properties:
- DisplayName
- Name
- SecondaryConsentEnabled
- where:
model-name: Service
set:
format-table:
properties:
- DisplayName
- Name
- ResourceType
- where:
model-name: FileDetails
set:
format-table:
properties:
- Name
- CreatedOn
- ChunkSize
- FileSize
- NumberOfChunks
- where:
model-name: SupportTicketDetails
set:
format-table:
properties:
- Name
- Title
- SupportTicketId
- Severity
- ServiceDisplayName
- CreatedDate
- where:
model-name: CommunicationDetails
set:
format-table:
properties:
- Name
- Sender
- Subject
- CreatedDate
- where:
model-name: ChatTranscriptDetails
set:
format-table:
properties:
- Name
- StartTime
- where:
subject: CommunicationsNoSubscription
parameter-name: CommunicationName
set:
alias: Name
- where:
subject: SupportTicketsNoSubscription
parameter-name: SupportTicketName
set:
alias: Name
- where:
subject: ChatTranscriptsNoSubscription
parameter-name: ChatTranscriptName
set:
alias: Name
- where:
subject: UploadFile
parameter-name: FileWorkspaceName
set:
alias: WorkspaceName
- where:
subject: UploadFilesNoSubscription
parameter-name: FileWorkspaceName
set:
alias: WorkspaceName
- where:
subject: FileWorkspacesNoSubscription
parameter-name: FileWorkspaceName
set:
alias: Name
- where:
subject: FilesNoSubscription
parameter-name: FileName
set:
alias: Name
- where:
subject: FilesNoSubscription
parameter-name: FileWorkspaceName
set:
alias: WorkspaceName
- where:
parameter-name: ContactDetailPreferredTimeZone
set:
completer:
name: Time Zone Completer
description: Gets the list of valid time zones
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\"'"
- where:
parameter-name: ContactDetailPreferredSupportLanguage
set:
completer:
name: Support Language Completer
description: Gets the list of valid support languages
script: "'\"en-us\"','\"es-es\"','\"fr-fr\"','\"de-de\"','\"it-it\"','\"ja-jp\"','\"ko-kr\"','\"ru-ru\"','\"pt-br\"','\"zh-tw\"','\"zh-hans\"'"
- where:
verb: New
subject: File
hide: true
- where:
verb: New
subject: FilesNoSubscription
hide: true
- where:
verb: Get
subject: SupportTicket
hide: true
- where:
verb: Get
subject: SupportTicketsNoSubscription
hide: true
- where:
verb: Update
subject: File
remove: true
- where:
verb: Update
subject: FilesNoSubscription
remove: true
- where:
verb: Invoke
subject: UploadFile
hide: true
- where:
verb: Invoke
subject: UploadFilesNoSubscription
hide: true
- where:
verb: Update
subject: Communication
remove: true
- where:
verb: Update
subject: CommunicationsNoSubscription
remove: true
- from: GetAzSupportTicket_List.cs
where: $
transform: $ = $.replace("!String.IsNullOrEmpty(_nextLink)" ,"!String.IsNullOrEmpty(_nextLink) && this._top <= 0");
- from: GetAzSupportTicketsNoSubscription_List.cs
where: $
transform: $ = $.replace("!String.IsNullOrEmpty(_nextLink)" ,"!String.IsNullOrEmpty(_nextLink) && this._top <= 0");
- from: GetAzSupportCommunication_List.cs
where: $
transform: $ = $.replace("!String.IsNullOrEmpty(_nextLink)" ,"!String.IsNullOrEmpty(_nextLink) && this._top <= 0");
- from: GetAzSupportCommunicationsNoSubscription_List.cs
where: $
transform: $ = $.replace("!String.IsNullOrEmpty(_nextLink)" ,"!String.IsNullOrEmpty(_nextLink) && this._top <= 0");
# Following are common directives which are normally required in all the RPs
# 1. Remove the unexpanded parameter set
# 2. For New-* cmdlets, ViaIdentity is not required
# Following two directives are v4 specific
- where:
variant: ^(Create|Update)(?!.*?Expanded|JsonFilePath|JsonString)
subject: ^(?!FileWorkspace|FileWorkspacesNoSubscription$).*
remove: true
- where:
variant: ^CreateViaIdentity.*$
remove: true
# Follow directive is v3 specific. If you are using v3, uncomment following directive and comments out two directives above
#- where:
# variant: ^Create$|^CreateViaIdentity$|^CreateViaIdentityExpanded$|^Update$|^UpdateViaIdentity$
# remove: true

# Remove the set-* cmdlet
# - where:
# verb: Set
# remove: true
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
{
"resourceType": "fileWorkspaces/files",
"apiVersion": "2024-04-01",
"learnMore": {
"url": "https://learn.microsoft.com/powershell/module/az.support"
},
"commands": [
{
"name": "Get-AzSupportFilesNoSubscription",
"description": "Returns details of a specific file in a work space.",
"path": "/providers/Microsoft.Support/fileWorkspaces/{fileWorkspaceName}/files/{fileName}",
"help": {
"learnMore": {
"url": "https://learn.microsoft.com/powershell/module/az.support/get-azsupportfilesnosubscription"
},
"parameterSets": [
{
"parameters": [
"-FileName <String>",
"-FileWorkspaceName <String>"
]
}
]
},
"examples": [
{
"description": "Returns details of a specific file in a work space.",
"parameters": [
{
"name": "-FileName",
"value": "[Path.fileName]"
},
{
"name": "-FileWorkspaceName",
"value": "[Path.fileWorkspaceName]"
}
]
}
]
},
{
"name": "Get-AzSupportFile",
"description": "Returns details of a specific file in a work space.",
"path": "/subscriptions/{subscriptionId}/providers/Microsoft.Support/fileWorkspaces/{fileWorkspaceName}/files/{fileName}",
"help": {
"learnMore": {
"url": "https://learn.microsoft.com/powershell/module/az.support/get-azsupportfile"
},
"parameterSets": [
{
"parameters": [
"-Name <String>",
"[-SubscriptionId <String[]>]",
"-WorkspaceName <String>"
]
}
]
},
"examples": [
{
"description": "Returns details of a specific file in a work space.",
"parameters": [
{
"name": "-Name",
"value": "[Path.fileName]"
},
{
"name": "-SubscriptionId",
"value": "[Path.subscriptionId]"
},
{
"name": "-WorkspaceName",
"value": "[Path.fileWorkspaceName]"
}
]
}
]
}
]
}
Loading