Skip to content

Commit

Permalink
Merge pull request #5 from grhuangmsft/users/grhuang/azsupport-autore…
Browse files Browse the repository at this point in the history
…st-feature

Make communication and support ticket properties required in readme
  • Loading branch information
grhuangmsft authored Mar 7, 2024
2 parents de3fcf5 + ef100cc commit da3c0a6
Show file tree
Hide file tree
Showing 19 changed files with 235 additions and 388 deletions.
2 changes: 1 addition & 1 deletion src/Support/Support.Autorest/Az.Support.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
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-AzSupportTicketChatTranscriptsNoSubscription', 'Get-AzSupportTicketCommunicationsNoSubscription', '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-AzSupportCommunication', 'Update-AzSupportCommunicationsNoSubscription', 'Update-AzSupportTicket', 'Update-AzSupportTicketsNoSubscription'
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'
Expand Down
26 changes: 26 additions & 0 deletions src/Support/Support.Autorest/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,32 @@ directive:
verb: Update
subject: CommunicationsNoSubscription
remove: true
- from: swagger-document
where: $.definitions.CommunicationDetails
transform: $.required = ['properties']
- from: swagger-document
where: $.definitions.SupportTicketDetails
transform: $.required = ['properties']
- from: swagger-document
where: $.paths["/providers/Microsoft.Support/supportTickets/{supportTicketName}/chatTranscripts"].get.operationId
transform: >-
return "ChatTranscriptsNoSubscription_List"
- from: swagger-document
where: $.paths["/providers/Microsoft.Support/supportTickets/{supportTicketName}/communications"].get.operationId
transform: >-
return "CommunicationsNoSubscription_List"
- 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: GetAzSupportTicketCommunicationsNoSubscription_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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ Lists all the available Microsoft Support REST API operations.
.Outputs
Microsoft.Azure.PowerShell.Cmdlets.Support.Models.IOperation
.Link
https://learn.microsoft.com/powershell/module/az.support/new-azsupportfile
https://learn.microsoft.com/powershell/module/az.support/get-azsupportoperation
#>
function Get-AzSupportOperation_List {
function Get-AzSupportOperation {
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Support.Models.IOperation])]
[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)]
param(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,15 +128,15 @@ process {
}

$PSBoundParameters.Remove('FilePath') | Out-Null
New-AzSupportFile -ErrorAction Stop -Name $FileName -FileSize $FileSize -ChunkSize $ChunkSize -NumberOfChunk $NumberOfChunks @PSBoundParameters
Az.Support.internal\New-AzSupportFile -ErrorAction Stop -Name $FileName -FileSize $FileSize -ChunkSize $ChunkSize -NumberOfChunk $NumberOfChunks @PSBoundParameters

$chunkIndex = 0
$startIndex = 0
$endIndex = $ChunkSize - 1

while($chunkIndex -lt $NumberOfChunks){
$FileContent = [convert]::ToBase64String($FileContentByteArray[$startIndex..$endIndex])
Invoke-AzSupportUploadFile -ErrorAction Stop -FileName $FileName -ChunkIndex $chunkIndex -Content $FileContent @PSBoundParameters
Az.Support.internal\Invoke-AzSupportUploadFile -ErrorAction Stop -FileName $FileName -ChunkIndex $chunkIndex -Content $FileContent @PSBoundParameters
$chunkIndex++
$startIndex = $endIndex + 1
$endIndex = $FileSize - 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,15 +122,15 @@ process {
}

$PSBoundParameters.Remove('FilePath') | Out-Null
New-AzSupportFilesNoSubscription -ErrorAction Stop -Name $FileName -FileSize $FileSize -ChunkSize $ChunkSize -NumberOfChunk $NumberOfChunks @PSBoundParameters
Az.Support.internal\New-AzSupportFilesNoSubscription -ErrorAction Stop -Name $FileName -FileSize $FileSize -ChunkSize $ChunkSize -NumberOfChunk $NumberOfChunks @PSBoundParameters

$chunkIndex = 0
$startIndex = 0
$endIndex = $ChunkSize - 1

while($chunkIndex -lt $NumberOfChunks){
$FileContent = [convert]::ToBase64String($FileContentByteArray[$startIndex..$endIndex])
Invoke-AzSupportUploadFilesNoSubscription -ErrorAction Stop -FileName $FileName -ChunkIndex $chunkIndex -Content $FileContent @PSBoundParameters
Az.Support.internal\Invoke-AzSupportUploadFilesNoSubscription -ErrorAction Stop -FileName $FileName -ChunkIndex $chunkIndex -Content $FileContent @PSBoundParameters
$chunkIndex++
$startIndex = $endIndex + 1
$endIndex = $FileSize - 1
Expand Down
17 changes: 0 additions & 17 deletions src/Support/Support.Autorest/docs/Az.Support.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,17 +49,6 @@ Get ticket details for an Azure subscription.
Support ticket data is available for 18 months after ticket creation.
If a ticket was created more than 18 months ago, a request for data might cause an error.

### [Get-AzSupportTicketChatTranscriptsNoSubscription](Get-AzSupportTicketChatTranscriptsNoSubscription.md)
Lists all chat transcripts for a support ticket

### [Get-AzSupportTicketCommunicationsNoSubscription](Get-AzSupportTicketCommunicationsNoSubscription.md)
Lists all communications (attachments not included) for a support ticket.
\<br/\>\</br\> You can also filter support ticket communications by _CreatedDate_ or _CommunicationType_ using the $filter parameter.
The only type of communication supported today is _Web_.
Output will be a paged result with _nextLink_, using which you can retrieve the next set of Communication results.
\<br/\>\<br/\>Support ticket data is available for 18 months after ticket creation.
If a ticket was created more than 18 months ago, a request for data might cause an error.

### [Get-AzSupportTicketsNoSubscription](Get-AzSupportTicketsNoSubscription.md)
Gets details for a specific support ticket.
Support ticket data is available for 18 months after ticket creation.
Expand Down Expand Up @@ -114,12 +103,6 @@ This API should be used to check the uniqueness of the name for support ticket c
Check the availability of a resource name.
This API should be used to check the uniqueness of the name for support ticket creation for the selected subscription.

### [Update-AzSupportCommunication](Update-AzSupportCommunication.md)
Adds a new customer communication to an Azure support ticket.

### [Update-AzSupportCommunicationsNoSubscription](Update-AzSupportCommunicationsNoSubscription.md)
Adds a new customer communication to an Azure support ticket.

### [Update-AzSupportTicket](Update-AzSupportTicket.md)
This API allows you to update the severity level, ticket status, advanced diagnostic consent and your contact information in the support ticket.\<br/\>\<br/\>Note: The severity levels cannot be changed if a support ticket is actively being worked upon by an Azure support engineer.
In such a case, contact your support engineer to request severity update by adding a new communication using the Communications API.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,13 @@ Returns chatTranscript details for a no subscription support ticket.

## SYNTAX

### Get (Default)
### List (Default)
```
Get-AzSupportChatTranscriptsNoSubscription -SupportTicketName <String> [-DefaultProfile <PSObject>]
[<CommonParameters>]
```

### Get
```
Get-AzSupportChatTranscriptsNoSubscription -ChatTranscriptName <String> -SupportTicketName <String>
[-DefaultProfile <PSObject>] [<CommonParameters>]
Expand Down Expand Up @@ -127,7 +133,7 @@ Support ticket name.
```yaml
Type: System.String
Parameter Sets: Get
Parameter Sets: Get, List
Aliases:

Required: True
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,13 @@ Returns communication details for a support ticket.

## SYNTAX

### Get (Default)
### List (Default)
```
Get-AzSupportCommunicationsNoSubscription -SupportTicketName <String> [-Filter <String>] [-Top <Int32>]
[-DefaultProfile <PSObject>] [<CommonParameters>]
```

### Get
```
Get-AzSupportCommunicationsNoSubscription -CommunicationName <String> -SupportTicketName <String>
[-DefaultProfile <PSObject>] [<CommonParameters>]
Expand Down Expand Up @@ -90,6 +96,24 @@ Accept pipeline input: False
Accept wildcard characters: False
```
### -Filter
The filter to apply on the operation.
You can filter by communicationType and createdDate properties.
CommunicationType supports Equals ('eq') operator and createdDate supports Greater Than ('gt') and Greater Than or Equals ('ge') operators.
You may combine the CommunicationType and CreatedDate filters by Logical And ('and') operator.
```yaml
Type: System.String
Parameter Sets: List
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -InputObject
Identity Parameter
To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
Expand Down Expand Up @@ -127,7 +151,7 @@ Support ticket name.
```yaml
Type: System.String
Parameter Sets: Get
Parameter Sets: Get, List
Aliases:

Required: True
Expand All @@ -137,6 +161,22 @@ Accept pipeline input: False
Accept wildcard characters: False
```
### -Top
The number of values to return in the collection.
Default is 10 and max is 10.
```yaml
Type: System.Int32
Parameter Sets: List
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
Expand Down
6 changes: 3 additions & 3 deletions src/Support/Support.Autorest/docs/Get-AzSupportOperation.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Get-AzSupportOperation [-DefaultProfile <PSObject>] [<CommonParameters>]
```

## DESCRIPTION

Lists all the available Microsoft Support REST API operations.

## EXAMPLES

Expand Down Expand Up @@ -46,7 +46,8 @@ Lists all the available Microsoft Support REST API operations.
## PARAMETERS

### -DefaultProfile

The DefaultProfile parameter is not functional.
Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.

```yaml
Type: System.Management.Automation.PSObject
Expand All @@ -63,7 +64,6 @@ Accept wildcard characters: False
### CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
## INPUTS
## OUTPUTS
Expand Down

This file was deleted.

Loading

0 comments on commit da3c0a6

Please sign in to comment.