Skip to content

Commit de3fcf5

Browse files
authored
Merge pull request #4 from shreyakumar3093/users/shreyakumar/grhuang/azsupport-autorest
Users/shreyakumar/grhuang/azsupport autorest
2 parents 762b446 + 1a21b88 commit de3fcf5

File tree

49 files changed

+5087
-871
lines changed

Some content is hidden

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

49 files changed

+5087
-871
lines changed

src/Support/Support.Autorest/Az.Support.psd1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
DotNetFrameworkVersion = '4.7.2'
1212
RequiredAssemblies = './bin/Az.Support.private.dll'
1313
FormatsToProcess = './Az.Support.format.ps1xml'
14-
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'
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-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'
1515
PrivateData = @{
1616
PSData = @{
1717
Tags = 'Azure', 'ResourceManager', 'ARM', 'PSModule', 'Support'

src/Support/Support.Autorest/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,14 @@ directive:
127127
verb: Invoke
128128
subject: UploadFilesNoSubscription
129129
hide: true
130+
- where:
131+
verb: Update
132+
subject: Communication
133+
remove: true
134+
- where:
135+
verb: Update
136+
subject: CommunicationsNoSubscription
137+
remove: true
130138
# Following are common directives which are normally required in all the RPs
131139
# 1. Remove the unexpanded parameter set
132140
# 2. For New-* cmdlets, ViaIdentity is not required
Lines changed: 164 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,164 @@
1+
2+
# ----------------------------------------------------------------------------------
3+
# Copyright (c) Microsoft Corporation. All rights reserved.
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
# Unless required by applicable law or agreed to in writing, software
9+
# distributed under the License is distributed on an "AS IS" BASIS,
10+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
# See the License for the specific language governing permissions and
12+
# limitations under the License.
13+
# Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code
14+
# is regenerated.
15+
# ----------------------------------------------------------------------------------
16+
17+
<#
18+
.Synopsis
19+
Lists all the available Microsoft Support REST API operations.
20+
.Description
21+
Lists all the available Microsoft Support REST API operations.
22+
.Example
23+
{{ Add code here }}
24+
.Example
25+
{{ Add code here }}
26+
27+
.Outputs
28+
Microsoft.Azure.PowerShell.Cmdlets.Support.Models.IOperation
29+
.Link
30+
https://learn.microsoft.com/powershell/module/az.support/new-azsupportfile
31+
#>
32+
function Get-AzSupportOperation_List {
33+
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Support.Models.IOperation])]
34+
[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)]
35+
param(
36+
[Parameter()]
37+
[Alias('AzureRMContext', 'AzureCredential')]
38+
[ValidateNotNull()]
39+
[Microsoft.Azure.PowerShell.Cmdlets.Support.Category('Azure')]
40+
[System.Management.Automation.PSObject]
41+
# The DefaultProfile parameter is not functional.
42+
# Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.
43+
${DefaultProfile},
44+
45+
[Parameter(DontShow)]
46+
[Microsoft.Azure.PowerShell.Cmdlets.Support.Category('Runtime')]
47+
[System.Management.Automation.SwitchParameter]
48+
# Wait for .NET debugger to attach
49+
${Break},
50+
51+
[Parameter(DontShow)]
52+
[ValidateNotNull()]
53+
[Microsoft.Azure.PowerShell.Cmdlets.Support.Category('Runtime')]
54+
[Microsoft.Azure.PowerShell.Cmdlets.Support.Runtime.SendAsyncStep[]]
55+
# SendAsync Pipeline Steps to be appended to the front of the pipeline
56+
${HttpPipelineAppend},
57+
58+
[Parameter(DontShow)]
59+
[ValidateNotNull()]
60+
[Microsoft.Azure.PowerShell.Cmdlets.Support.Category('Runtime')]
61+
[Microsoft.Azure.PowerShell.Cmdlets.Support.Runtime.SendAsyncStep[]]
62+
# SendAsync Pipeline Steps to be prepended to the front of the pipeline
63+
${HttpPipelinePrepend},
64+
65+
[Parameter(DontShow)]
66+
[Microsoft.Azure.PowerShell.Cmdlets.Support.Category('Runtime')]
67+
[System.Uri]
68+
# The URI for the proxy server to use
69+
${Proxy},
70+
71+
[Parameter(DontShow)]
72+
[ValidateNotNull()]
73+
[Microsoft.Azure.PowerShell.Cmdlets.Support.Category('Runtime')]
74+
[System.Management.Automation.PSCredential]
75+
# Credentials for a proxy server to use for the remote call
76+
${ProxyCredential},
77+
78+
[Parameter(DontShow)]
79+
[Microsoft.Azure.PowerShell.Cmdlets.Support.Category('Runtime')]
80+
[System.Management.Automation.SwitchParameter]
81+
# Use the default credentials for the proxy
82+
${ProxyUseDefaultCredentials}
83+
)
84+
85+
begin {
86+
try {
87+
$outBuffer = $null
88+
if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) {
89+
$PSBoundParameters['OutBuffer'] = 1
90+
}
91+
$parameterSet = $PSCmdlet.ParameterSetName
92+
93+
if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {
94+
[Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString()
95+
}
96+
$preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
97+
if ($preTelemetryId -eq '') {
98+
[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString()
99+
[Microsoft.Azure.PowerShell.Cmdlets.Support.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet)
100+
} else {
101+
$internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
102+
if ($internalCalledCmdlets -eq '') {
103+
[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name
104+
} else {
105+
[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name
106+
}
107+
[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal'
108+
}
109+
110+
$mapping = @{
111+
List = 'Az.Support.private\Get-AzSupportOperation_List';
112+
}
113+
# if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) {
114+
# $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
115+
# }
116+
$cmdInfo = Get-Command -Name $mapping[$parameterSet]
117+
[Microsoft.Azure.PowerShell.Cmdlets.Support.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
118+
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)){
119+
[Microsoft.Azure.PowerShell.Cmdlets.Support.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
120+
[Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name)
121+
}
122+
$wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
123+
$scriptCmd = {& $wrappedCmd @PSBoundParameters}
124+
$steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
125+
$steppablePipeline.Begin($PSCmdlet)
126+
} catch {
127+
[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
128+
throw
129+
}
130+
}
131+
132+
process {
133+
try {
134+
$steppablePipeline.Process($_)
135+
} catch {
136+
[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
137+
throw
138+
}
139+
140+
finally {
141+
$backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
142+
$backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
143+
[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
144+
}
145+
146+
}
147+
end {
148+
try {
149+
$steppablePipeline.End()
150+
151+
[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId
152+
[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets
153+
if ($preTelemetryId -eq '') {
154+
[Microsoft.Azure.PowerShell.Cmdlets.Support.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet)
155+
[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
156+
}
157+
[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId
158+
159+
} catch {
160+
[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
161+
throw
162+
}
163+
}
164+
}

src/Support/Support.Autorest/docs/Az.Support.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ Gets details for a specific file workspace in an Azure subscription.
3535
### [Get-AzSupportFileWorkspacesNoSubscription](Get-AzSupportFileWorkspacesNoSubscription.md)
3636
Gets details for a specific file workspace.
3737

38+
### [Get-AzSupportOperation](Get-AzSupportOperation.md)
39+
Lists all the available Microsoft Support REST API operations.
40+
3841
### [Get-AzSupportProblemClassification](Get-AzSupportProblemClassification.md)
3942
Get problem classification details for a specific Azure service.
4043

src/Support/Support.Autorest/docs/Get-AzSupportChatTranscript.md

Lines changed: 49 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,27 +40,68 @@ Returns chatTranscript details for a support ticket under a subscription.
4040

4141
## EXAMPLES
4242

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

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

52-
{{ Add description here }}
56+
Lists all chat transcripts for a support ticket under subscription
5357

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

5963
```output
60-
{{ Add output here (remove the output block if the example doesn't have an output) }}
64+
Id : /subscriptions/76cb77fa-8b17-4eab-9493-b65dace99813/providers/Microsoft.Support/supportT
65+
ickets/58cf91d7-bedfb285-617ecf73-d627-4bfd-9298-5950da2170b7/chatTranscripts/595df7b4-1
66+
67f-4f3e-8292-f0ba2b8a53f9
67+
Message : {{
68+
"contentType": "text",
69+
"communicationDirection": "Inbound",
70+
"sender": "",
71+
"body": "Hey",
72+
"createdDate": "2023-08-11T19:19:33.0000000Z"
73+
}, {
74+
"contentType": "text",
75+
"communicationDirection": "Outbound",
76+
"sender": "Aditi Takle",
77+
"body": "hi",
78+
"createdDate": "2023-08-11T19:19:38.0000000Z"
79+
}, {
80+
"contentType": "text",
81+
"communicationDirection": "Outbound",
82+
"sender": "Damian Spoltore",
83+
"body": "hi Aditi, I\u0027m Damian",
84+
"createdDate": "2023-08-11T19:24:19.0000000Z"
85+
}, {
86+
"contentType": "text",
87+
"communicationDirection": "Outbound",
88+
"sender": "Damian Spoltore",
89+
"body": "I was entering to test",
90+
"createdDate": "2023-08-11T19:24:24.0000000Z"
91+
}}
92+
Name : 595df7b4-167f-4f3e-8292-f0ba2b8a53f9
93+
ResourceGroupName :
94+
StartTime : 8/11/2023 7:27:49 PM
95+
SystemDataCreatedAt :
96+
SystemDataCreatedBy :
97+
SystemDataCreatedByType :
98+
SystemDataLastModifiedAt :
99+
SystemDataLastModifiedBy :
100+
SystemDataLastModifiedByType :
101+
Type : Microsoft.Support/chatTranscripts
61102
```
62103

63-
{{ Add description here }}
104+
Returns chatTranscript details for a support ticket under a subscription.
64105

65106
## PARAMETERS
66107

0 commit comments

Comments
 (0)