diff --git a/src/Support/Support.Autorest/custom/csharp/NewAzSupportCommunication_CreateExpanded.cs b/src/Support/Support.Autorest/custom/csharp/NewAzSupportCommunication_CreateExpanded.cs new file mode 100644 index 000000000000..dda7085345b7 --- /dev/null +++ b/src/Support/Support.Autorest/custom/csharp/NewAzSupportCommunication_CreateExpanded.cs @@ -0,0 +1,17 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. + +using System.Net.Http; +using System.Threading.Tasks; +using Microsoft.Azure.PowerShell.Cmdlets.Support.Models; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Support.Cmdlets +{ + public partial class NewAzSupportCommunication_CreateExpanded + { + partial void overrideOnDefault(HttpResponseMessage responseMessage, Task errorResponseTask, ref Task returnNow) + { + this.WriteError(responseMessage, errorResponseTask, ref returnNow); + } + } +} \ No newline at end of file diff --git a/src/Support/Support.Autorest/custom/csharp/NewAzSupportCommunicationsNoSubscription_CreateExpanded.cs b/src/Support/Support.Autorest/custom/csharp/NewAzSupportCommunicationsNoSubscription_CreateExpanded.cs new file mode 100644 index 000000000000..6b79f6f1acbe --- /dev/null +++ b/src/Support/Support.Autorest/custom/csharp/NewAzSupportCommunicationsNoSubscription_CreateExpanded.cs @@ -0,0 +1,17 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. + +using System.Net.Http; +using System.Threading.Tasks; +using Microsoft.Azure.PowerShell.Cmdlets.Support.Models; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Support.Cmdlets +{ + public partial class NewAzSupportCommunicationsNoSubscription_CreateExpanded + { + partial void overrideOnDefault(HttpResponseMessage responseMessage, Task errorResponseTask, ref Task returnNow) + { + this.WriteError(responseMessage, errorResponseTask, ref returnNow); + } + } +} \ No newline at end of file diff --git a/src/Support/Support.Autorest/custom/csharp/NewAzSupportTicket_CreateExpanded.cs b/src/Support/Support.Autorest/custom/csharp/NewAzSupportTicket_CreateExpanded.cs new file mode 100644 index 000000000000..1baf777cef5e --- /dev/null +++ b/src/Support/Support.Autorest/custom/csharp/NewAzSupportTicket_CreateExpanded.cs @@ -0,0 +1,17 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. + +using System.Net.Http; +using System.Threading.Tasks; +using Microsoft.Azure.PowerShell.Cmdlets.Support.Models; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Support.Cmdlets +{ + public partial class NewAzSupportTicket_CreateExpanded + { + partial void overrideOnDefault(HttpResponseMessage responseMessage, Task errorResponseTask, ref Task returnNow) + { + this.WriteError(responseMessage, errorResponseTask, ref returnNow); + } + } +} \ No newline at end of file diff --git a/src/Support/Support.Autorest/custom/csharp/NewAzSupportTicketsNoSubscription_CreateExpanded.cs b/src/Support/Support.Autorest/custom/csharp/NewAzSupportTicketsNoSubscription_CreateExpanded.cs new file mode 100644 index 000000000000..e126746b8815 --- /dev/null +++ b/src/Support/Support.Autorest/custom/csharp/NewAzSupportTicketsNoSubscription_CreateExpanded.cs @@ -0,0 +1,17 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. + +using System.Net.Http; +using System.Threading.Tasks; +using Microsoft.Azure.PowerShell.Cmdlets.Support.Models; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Support.Cmdlets +{ + public partial class NewAzSupportTicketsNoSubscription_CreateExpanded + { + partial void overrideOnDefault(HttpResponseMessage responseMessage, Task errorResponseTask, ref Task returnNow) + { + this.WriteError(responseMessage, errorResponseTask, ref returnNow); + } + } +} \ No newline at end of file diff --git a/src/Support/Support.Autorest/custom/csharp/RestErrorHandler.cs b/src/Support/Support.Autorest/custom/csharp/RestErrorHandler.cs new file mode 100644 index 000000000000..b52bcb7bc7ca --- /dev/null +++ b/src/Support/Support.Autorest/custom/csharp/RestErrorHandler.cs @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. + +using System.Management.Automation; +using System.Net.Http; +using System.Threading.Tasks; +using Microsoft.Azure.PowerShell.Cmdlets.Support.Models; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Support.Cmdlets +{ + internal static class CmdletRestExtension + { + public static void WriteError(this Cmdlet cmdlet, HttpResponseMessage responseMessage, Task errorResponseTask, ref Task returnNow) + { + var errorString = responseMessage.Content.ReadAsStringAsync().ConfigureAwait(false).GetAwaiter().GetResult(); + cmdlet.WriteError(new ErrorRecord(new System.Exception(), null, ErrorCategory.InvalidOperation, null) + { + ErrorDetails = new ErrorDetails(errorString) { RecommendedAction = string.Empty } + }); + + returnNow = Task.FromResult(true); + } + } +} \ No newline at end of file diff --git a/src/Support/Support.Autorest/custom/csharp/UpdateAzSupportTicket_UpdateExpanded.cs b/src/Support/Support.Autorest/custom/csharp/UpdateAzSupportTicket_UpdateExpanded.cs new file mode 100644 index 000000000000..998dfa6fc3f4 --- /dev/null +++ b/src/Support/Support.Autorest/custom/csharp/UpdateAzSupportTicket_UpdateExpanded.cs @@ -0,0 +1,17 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. + +using System.Net.Http; +using System.Threading.Tasks; +using Microsoft.Azure.PowerShell.Cmdlets.Support.Models; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Support.Cmdlets +{ + public partial class UpdateAzSupportTicket_UpdateExpanded + { + partial void overrideOnDefault(HttpResponseMessage responseMessage, Task errorResponseTask, ref Task returnNow) + { + this.WriteError(responseMessage, errorResponseTask, ref returnNow); + } + } +} \ No newline at end of file diff --git a/src/Support/Support.Autorest/custom/csharp/UpdateAzSupportTicket_UpdateViaIdentityExpanded.cs b/src/Support/Support.Autorest/custom/csharp/UpdateAzSupportTicket_UpdateViaIdentityExpanded.cs new file mode 100644 index 000000000000..d5ad29278b29 --- /dev/null +++ b/src/Support/Support.Autorest/custom/csharp/UpdateAzSupportTicket_UpdateViaIdentityExpanded.cs @@ -0,0 +1,17 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. + +using System.Net.Http; +using System.Threading.Tasks; +using Microsoft.Azure.PowerShell.Cmdlets.Support.Models; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Support.Cmdlets +{ + public partial class UpdateAzSupportTicket_UpdateViaIdentityExpanded + { + partial void overrideOnDefault(HttpResponseMessage responseMessage, Task errorResponseTask, ref Task returnNow) + { + this.WriteError(responseMessage, errorResponseTask, ref returnNow); + } + } +} \ No newline at end of file diff --git a/src/Support/Support.Autorest/custom/csharp/UpdateAzSupportTicketsNoSubscription_UpdateExpanded.cs b/src/Support/Support.Autorest/custom/csharp/UpdateAzSupportTicketsNoSubscription_UpdateExpanded.cs new file mode 100644 index 000000000000..bc3382b9f7b6 --- /dev/null +++ b/src/Support/Support.Autorest/custom/csharp/UpdateAzSupportTicketsNoSubscription_UpdateExpanded.cs @@ -0,0 +1,17 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. + +using System.Net.Http; +using System.Threading.Tasks; +using Microsoft.Azure.PowerShell.Cmdlets.Support.Models; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Support.Cmdlets +{ + public partial class UpdateAzSupportTicketsNoSubscription_UpdateExpanded + { + partial void overrideOnDefault(HttpResponseMessage responseMessage, Task errorResponseTask, ref Task returnNow) + { + this.WriteError(responseMessage, errorResponseTask, ref returnNow); + } + } +} \ No newline at end of file diff --git a/src/Support/Support.Autorest/custom/csharp/UpdateAzSupportTicketsNoSubscription_UpdateViaIdentityExpanded.cs b/src/Support/Support.Autorest/custom/csharp/UpdateAzSupportTicketsNoSubscription_UpdateViaIdentityExpanded.cs new file mode 100644 index 000000000000..b8f3ca67f9bd --- /dev/null +++ b/src/Support/Support.Autorest/custom/csharp/UpdateAzSupportTicketsNoSubscription_UpdateViaIdentityExpanded.cs @@ -0,0 +1,17 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. + +using System.Net.Http; +using System.Threading.Tasks; +using Microsoft.Azure.PowerShell.Cmdlets.Support.Models; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Support.Cmdlets +{ + public partial class UpdateAzSupportTicketsNoSubscription_UpdateViaIdentityExpanded + { + partial void overrideOnDefault(HttpResponseMessage responseMessage, Task errorResponseTask, ref Task returnNow) + { + this.WriteError(responseMessage, errorResponseTask, ref returnNow); + } + } +} \ No newline at end of file