Skip to content

Commit

Permalink
Merge pull request #4 from shreyakumar3093/users/shreyakumar/grhuang/…
Browse files Browse the repository at this point in the history
…azsupport-autorest

Users/shreyakumar/grhuang/azsupport autorest
  • Loading branch information
grhuangmsft committed Feb 26, 2024
2 parents 762b446 + 1a21b88 commit de3fcf5
Show file tree
Hide file tree
Showing 49 changed files with 5,087 additions and 871 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-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-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'
PrivateData = @{
PSData = @{
Tags = 'Azure', 'ResourceManager', 'ARM', 'PSModule', 'Support'
Expand Down
8 changes: 8 additions & 0 deletions src/Support/Support.Autorest/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,14 @@ directive:
verb: Invoke
subject: UploadFilesNoSubscription
hide: true
- where:
verb: Update
subject: Communication
remove: true
- where:
verb: Update
subject: CommunicationsNoSubscription
remove: true
# 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
164 changes: 164 additions & 0 deletions src/Support/Support.Autorest/custom/Get-AzSupportOperation_List.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,164 @@

# ----------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code
# is regenerated.
# ----------------------------------------------------------------------------------

<#
.Synopsis
Lists all the available Microsoft Support REST API operations.
.Description
Lists all the available Microsoft Support REST API operations.
.Example
{{ Add code here }}
.Example
{{ Add code here }}
.Outputs
Microsoft.Azure.PowerShell.Cmdlets.Support.Models.IOperation
.Link
https://learn.microsoft.com/powershell/module/az.support/new-azsupportfile
#>
function Get-AzSupportOperation_List {
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Support.Models.IOperation])]
[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)]
param(
[Parameter()]
[Alias('AzureRMContext', 'AzureCredential')]
[ValidateNotNull()]
[Microsoft.Azure.PowerShell.Cmdlets.Support.Category('Azure')]
[System.Management.Automation.PSObject]
# The DefaultProfile parameter is not functional.
# Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.
${DefaultProfile},

[Parameter(DontShow)]
[Microsoft.Azure.PowerShell.Cmdlets.Support.Category('Runtime')]
[System.Management.Automation.SwitchParameter]
# Wait for .NET debugger to attach
${Break},

[Parameter(DontShow)]
[ValidateNotNull()]
[Microsoft.Azure.PowerShell.Cmdlets.Support.Category('Runtime')]
[Microsoft.Azure.PowerShell.Cmdlets.Support.Runtime.SendAsyncStep[]]
# SendAsync Pipeline Steps to be appended to the front of the pipeline
${HttpPipelineAppend},

[Parameter(DontShow)]
[ValidateNotNull()]
[Microsoft.Azure.PowerShell.Cmdlets.Support.Category('Runtime')]
[Microsoft.Azure.PowerShell.Cmdlets.Support.Runtime.SendAsyncStep[]]
# SendAsync Pipeline Steps to be prepended to the front of the pipeline
${HttpPipelinePrepend},

[Parameter(DontShow)]
[Microsoft.Azure.PowerShell.Cmdlets.Support.Category('Runtime')]
[System.Uri]
# The URI for the proxy server to use
${Proxy},

[Parameter(DontShow)]
[ValidateNotNull()]
[Microsoft.Azure.PowerShell.Cmdlets.Support.Category('Runtime')]
[System.Management.Automation.PSCredential]
# Credentials for a proxy server to use for the remote call
${ProxyCredential},

[Parameter(DontShow)]
[Microsoft.Azure.PowerShell.Cmdlets.Support.Category('Runtime')]
[System.Management.Automation.SwitchParameter]
# Use the default credentials for the proxy
${ProxyUseDefaultCredentials}
)

begin {
try {
$outBuffer = $null
if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) {
$PSBoundParameters['OutBuffer'] = 1
}
$parameterSet = $PSCmdlet.ParameterSetName

if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {
[Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString()
}
$preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
if ($preTelemetryId -eq '') {
[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString()
[Microsoft.Azure.PowerShell.Cmdlets.Support.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet)
} else {
$internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
if ($internalCalledCmdlets -eq '') {
[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name
} else {
[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name
}
[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal'
}

$mapping = @{
List = 'Az.Support.private\Get-AzSupportOperation_List';
}
# if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) {
# $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
# }
$cmdInfo = Get-Command -Name $mapping[$parameterSet]
[Microsoft.Azure.PowerShell.Cmdlets.Support.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Support.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){
[Microsoft.Azure.PowerShell.Cmdlets.Support.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
[Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name)
}
$wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
$scriptCmd = {& $wrappedCmd @PSBoundParameters}
$steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
$steppablePipeline.Begin($PSCmdlet)
} catch {
[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
throw
}
}

process {
try {
$steppablePipeline.Process($_)
} catch {
[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
throw
}

finally {
$backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
$backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
}

}
end {
try {
$steppablePipeline.End()

[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId
[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets
if ($preTelemetryId -eq '') {
[Microsoft.Azure.PowerShell.Cmdlets.Support.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet)
[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
}
[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId

} catch {
[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
throw
}
}
}
3 changes: 3 additions & 0 deletions src/Support/Support.Autorest/docs/Az.Support.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ Gets details for a specific file workspace in an Azure subscription.
### [Get-AzSupportFileWorkspacesNoSubscription](Get-AzSupportFileWorkspacesNoSubscription.md)
Gets details for a specific file workspace.

### [Get-AzSupportOperation](Get-AzSupportOperation.md)
Lists all the available Microsoft Support REST API operations.

### [Get-AzSupportProblemClassification](Get-AzSupportProblemClassification.md)
Get problem classification details for a specific Azure service.

Expand Down
57 changes: 49 additions & 8 deletions src/Support/Support.Autorest/docs/Get-AzSupportChatTranscript.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,27 +40,68 @@ Returns chatTranscript details for a support ticket under a subscription.

## EXAMPLES

### Example 1: {{ Add title here }}
### Example 1: Get List of chat transcripts at subscription level
```powershell
{{ Add code here }}
Get-AzSupportChatTranscript -SupportTicketName "58cf91d7-bedfb285-617ecf73-d627-4bfd-9298-5950da2170b7"
```

```output
{{ Add output here (remove the output block if the example doesn't have an output) }}
Name SystemDataCreatedAt SystemDataCreatedBy SystemDataCreatedByType SystemDataLastModi
fiedAt
---- ------------------- ------------------- ----------------------- ------------------
595df7b4-167f-4f3e-8292-f0ba2b8a53f9
f8b45cd6-a8ec-40e2-b846-a28b848553cf
```

{{ Add description here }}
Lists all chat transcripts for a support ticket under subscription

### Example 2: {{ Add title here }}
### Example 2: Get single chat transcript at subscription level
```powershell
{{ Add code here }}
Get-AzSupportChatTranscript -SupportTicketName "58cf91d7-bedfb285-617ecf73-d627-4bfd-9298-5950da2170b7" -Name "595df7b4-167f-4f3e-8292-f0ba2b8a53f9"
```

```output
{{ Add output here (remove the output block if the example doesn't have an output) }}
Id : /subscriptions/76cb77fa-8b17-4eab-9493-b65dace99813/providers/Microsoft.Support/supportT
ickets/58cf91d7-bedfb285-617ecf73-d627-4bfd-9298-5950da2170b7/chatTranscripts/595df7b4-1
67f-4f3e-8292-f0ba2b8a53f9
Message : {{
"contentType": "text",
"communicationDirection": "Inbound",
"sender": "",
"body": "Hey",
"createdDate": "2023-08-11T19:19:33.0000000Z"
}, {
"contentType": "text",
"communicationDirection": "Outbound",
"sender": "Aditi Takle",
"body": "hi",
"createdDate": "2023-08-11T19:19:38.0000000Z"
}, {
"contentType": "text",
"communicationDirection": "Outbound",
"sender": "Damian Spoltore",
"body": "hi Aditi, I\u0027m Damian",
"createdDate": "2023-08-11T19:24:19.0000000Z"
}, {
"contentType": "text",
"communicationDirection": "Outbound",
"sender": "Damian Spoltore",
"body": "I was entering to test",
"createdDate": "2023-08-11T19:24:24.0000000Z"
}}
Name : 595df7b4-167f-4f3e-8292-f0ba2b8a53f9
ResourceGroupName :
StartTime : 8/11/2023 7:27:49 PM
SystemDataCreatedAt :
SystemDataCreatedBy :
SystemDataCreatedByType :
SystemDataLastModifiedAt :
SystemDataLastModifiedBy :
SystemDataLastModifiedByType :
Type : Microsoft.Support/chatTranscripts
```

{{ Add description here }}
Returns chatTranscript details for a support ticket under a subscription.

## PARAMETERS

Expand Down
Loading

0 comments on commit de3fcf5

Please sign in to comment.