From 44a283a602576d3bf01f4909a7a9479eb1a6c64e Mon Sep 17 00:00:00 2001 From: JoyerJin <116236375+JoyerJin@users.noreply.github.com> Date: Tue, 19 Nov 2024 17:54:30 +0800 Subject: [PATCH 1/3] generate PowerBIEmbedded and PowerBIDedicated SDK, add project remove package reference Microsoft.Azure.Management.PowerBIDedicated Version 0.11.0-preview --- .../PowerBI.Test/PowerBI.Test.csproj | 2 +- src/PowerBIEmbedded/PowerBI/PowerBI.csproj | 2 +- .../Customizations/AzureCapacityClient.cs | 18 + .../CustomCapacitiesOperations.cs | 151 ++ .../Generated/CapacitiesOperations.cs | 2355 +++++++++++++++++ .../CapacitiesOperationsExtensions.cs | 683 +++++ .../Generated/ICapacitiesOperations.cs | 423 +++ .../Generated/IOperations.cs | 68 + .../IPowerBIDedicatedManagementClient.cs | 86 + .../Generated/Models/DedicatedCapacity.cs | 113 + .../Models/DedicatedCapacityAdministrators.cs | 56 + .../DedicatedCapacityUpdateParameters.cs | 90 + .../Generated/Models/ErrorResponse.cs | 60 + .../Models/ErrorResponseException.cs | 62 + .../Generated/Models/Operation.cs | 61 + .../Generated/Models/OperationDisplay.cs | 70 + .../Generated/Models/Page.cs | 53 + .../Generated/Models/Page1.cs | 53 + .../Generated/Models/ProvisioningState.cs | 32 + .../Generated/Models/Resource.cs | 123 + .../Generated/Models/ResourceSku.cs | 76 + .../Models/SkuDetailsForExistingResource.cs | 67 + ...SkuEnumerationForExistingResourceResult.cs | 57 + .../SkuEnumerationForNewResourceResult.cs | 56 + .../Generated/Models/SkuTier.cs | 21 + .../Generated/Models/State.cs | 32 + .../Generated/Operations.cs | 390 +++ .../Generated/OperationsExtensions.cs | 87 + .../PowerBIDedicatedManagementClient.cs | 369 +++ .../Generated/SdkInfo_PowerBIDedicated.cs | 28 + .../PowerBIDedicated.Management.Sdk.csproj | 13 + .../Properties/AssemblyInfo.cs | 29 + .../PowerBIDedicated.Management.Sdk/README.md | 34 + .../IPowerBIEmbeddedManagementClient.cs | 102 + .../IWorkspaceCollectionsOperations.cs | 303 +++ .../Generated/IWorkspacesOperations.cs | 53 + .../Generated/Models/AccessKeyName.cs | 60 + .../Generated/Models/AzureSku.cs | 53 + .../Generated/Models/CheckNameReason.cs | 22 + .../Generated/Models/CheckNameRequest.cs | 56 + .../Generated/Models/CheckNameResponse.cs | 73 + .../CreateWorkspaceCollectionRequest.cs | 70 + .../Generated/Models/Display.cs | 107 + .../Generated/Models/Error.cs | 66 + .../Generated/Models/ErrorDetail.cs | 58 + .../Generated/Models/ErrorException.cs | 61 + .../MigrateWorkspaceCollectionRequest.cs | 60 + .../Generated/Models/Operation.cs | 58 + .../Generated/Models/OperationList.cs | 48 + .../Generated/Models/Page.cs | 53 + .../UpdateWorkspaceCollectionRequest.cs | 62 + .../Generated/Models/Workspace.cs | 72 + .../Generated/Models/WorkspaceCollection.cs | 100 + .../Models/WorkspaceCollectionAccessKey.cs | 51 + .../Models/WorkspaceCollectionAccessKeys.cs | 58 + .../PowerBIEmbeddedManagementClient.cs | 538 ++++ ...werBIEmbeddedManagementClientExtensions.cs | 55 + ...SdkInfo_PowerBIEmbeddedManagementClient.cs | 30 + .../WorkspaceCollectionsOperations.cs | 1978 ++++++++++++++ ...orkspaceCollectionsOperationsExtensions.cs | 476 ++++ .../Generated/WorkspacesOperations.cs | 246 ++ .../WorkspacesOperationsExtensions.cs | 69 + .../PowerBIEmbedded.Management.Sdk.csproj | 13 + .../Properties/AssemblyInfo.cs | 29 + .../PowerBIEmbedded.Management.Sdk/README.md | 34 + src/PowerBIEmbedded/PowerBIEmbedded.sln | 40 +- .../PowerBIEmbedded/Az.PowerBIEmbedded.psd1 | 4 +- .../PowerBIEmbedded/PowerBIEmbedded.csproj | 6 +- 68 files changed, 10963 insertions(+), 21 deletions(-) create mode 100644 src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Customizations/AzureCapacityClient.cs create mode 100644 src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Customizations/CustomCapacitiesOperations.cs create mode 100644 src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/CapacitiesOperations.cs create mode 100644 src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/CapacitiesOperationsExtensions.cs create mode 100644 src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/ICapacitiesOperations.cs create mode 100644 src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/IOperations.cs create mode 100644 src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/IPowerBIDedicatedManagementClient.cs create mode 100644 src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/Models/DedicatedCapacity.cs create mode 100644 src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/Models/DedicatedCapacityAdministrators.cs create mode 100644 src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/Models/DedicatedCapacityUpdateParameters.cs create mode 100644 src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/Models/ErrorResponse.cs create mode 100644 src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/Models/ErrorResponseException.cs create mode 100644 src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/Models/Operation.cs create mode 100644 src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/Models/OperationDisplay.cs create mode 100644 src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/Models/Page.cs create mode 100644 src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/Models/Page1.cs create mode 100644 src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/Models/ProvisioningState.cs create mode 100644 src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/Models/Resource.cs create mode 100644 src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/Models/ResourceSku.cs create mode 100644 src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/Models/SkuDetailsForExistingResource.cs create mode 100644 src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/Models/SkuEnumerationForExistingResourceResult.cs create mode 100644 src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/Models/SkuEnumerationForNewResourceResult.cs create mode 100644 src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/Models/SkuTier.cs create mode 100644 src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/Models/State.cs create mode 100644 src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/Operations.cs create mode 100644 src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/OperationsExtensions.cs create mode 100644 src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/PowerBIDedicatedManagementClient.cs create mode 100644 src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/SdkInfo_PowerBIDedicated.cs create mode 100644 src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/PowerBIDedicated.Management.Sdk.csproj create mode 100644 src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Properties/AssemblyInfo.cs create mode 100644 src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/README.md create mode 100644 src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/IPowerBIEmbeddedManagementClient.cs create mode 100644 src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/IWorkspaceCollectionsOperations.cs create mode 100644 src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/IWorkspacesOperations.cs create mode 100644 src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/Models/AccessKeyName.cs create mode 100644 src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/Models/AzureSku.cs create mode 100644 src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/Models/CheckNameReason.cs create mode 100644 src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/Models/CheckNameRequest.cs create mode 100644 src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/Models/CheckNameResponse.cs create mode 100644 src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/Models/CreateWorkspaceCollectionRequest.cs create mode 100644 src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/Models/Display.cs create mode 100644 src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/Models/Error.cs create mode 100644 src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/Models/ErrorDetail.cs create mode 100644 src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/Models/ErrorException.cs create mode 100644 src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/Models/MigrateWorkspaceCollectionRequest.cs create mode 100644 src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/Models/Operation.cs create mode 100644 src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/Models/OperationList.cs create mode 100644 src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/Models/Page.cs create mode 100644 src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/Models/UpdateWorkspaceCollectionRequest.cs create mode 100644 src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/Models/Workspace.cs create mode 100644 src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/Models/WorkspaceCollection.cs create mode 100644 src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/Models/WorkspaceCollectionAccessKey.cs create mode 100644 src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/Models/WorkspaceCollectionAccessKeys.cs create mode 100644 src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/PowerBIEmbeddedManagementClient.cs create mode 100644 src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/PowerBIEmbeddedManagementClientExtensions.cs create mode 100644 src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/SdkInfo_PowerBIEmbeddedManagementClient.cs create mode 100644 src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/WorkspaceCollectionsOperations.cs create mode 100644 src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/WorkspaceCollectionsOperationsExtensions.cs create mode 100644 src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/WorkspacesOperations.cs create mode 100644 src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/WorkspacesOperationsExtensions.cs create mode 100644 src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/PowerBIEmbedded.Management.Sdk.csproj create mode 100644 src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Properties/AssemblyInfo.cs create mode 100644 src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/README.md diff --git a/src/PowerBIEmbedded/PowerBI.Test/PowerBI.Test.csproj b/src/PowerBIEmbedded/PowerBI.Test/PowerBI.Test.csproj index 81ec54719790..6b64dbc746b2 100644 --- a/src/PowerBIEmbedded/PowerBI.Test/PowerBI.Test.csproj +++ b/src/PowerBIEmbedded/PowerBI.Test/PowerBI.Test.csproj @@ -11,7 +11,7 @@ - + \ No newline at end of file diff --git a/src/PowerBIEmbedded/PowerBI/PowerBI.csproj b/src/PowerBIEmbedded/PowerBI/PowerBI.csproj index d3b52e1f33c0..4dc8697c24fe 100644 --- a/src/PowerBIEmbedded/PowerBI/PowerBI.csproj +++ b/src/PowerBIEmbedded/PowerBI/PowerBI.csproj @@ -12,11 +12,11 @@ - + diff --git a/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Customizations/AzureCapacityClient.cs b/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Customizations/AzureCapacityClient.cs new file mode 100644 index 000000000000..3c0404096cb8 --- /dev/null +++ b/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Customizations/AzureCapacityClient.cs @@ -0,0 +1,18 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. + +using System; + +namespace Microsoft.Azure.Management.PowerBIDedicated +{ + /// + public partial class PowerBIDedicatedManagementClient + { + partial void CustomInitialize() + { + // Override the capacities operations which includes override of UpdateWithHttpMessagesAsync to support non long running operation in case of OK response + this.Capacities = new CustomCapacitiesOperations(this.Capacities, this); + } + } +} diff --git a/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Customizations/CustomCapacitiesOperations.cs b/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Customizations/CustomCapacitiesOperations.cs new file mode 100644 index 000000000000..972bca10bce0 --- /dev/null +++ b/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Customizations/CustomCapacitiesOperations.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. + +using Microsoft.Azure.Management.PowerBIDedicated.Models; +using Microsoft.Rest.Azure; +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; + +namespace Microsoft.Azure.Management.PowerBIDedicated +{ + /// + /// Customize UpdateWithHttpMessagesAsync to skip LRO when response is OK. -- migration engineer + /// + public class CustomCapacitiesOperations : ICapacitiesOperations + { + private readonly ICapacitiesOperations innerCapacityOperations; + private readonly PowerBIDedicatedManagementClient client; + + internal CustomCapacitiesOperations(ICapacitiesOperations inner, PowerBIDedicatedManagementClient client) + { + this.innerCapacityOperations = inner; + this.client = client; + } + + public PowerBIDedicatedManagementClient Client => client; + + /// + public async Task> GetDetailsWithHttpMessagesAsync(string resourceGroupName, string dedicatedCapacityName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + return await innerCapacityOperations + .GetDetailsWithHttpMessagesAsync(resourceGroupName, dedicatedCapacityName, customHeaders, cancellationToken) + .ConfigureAwait(false); + } + + /// + public async Task> CreateWithHttpMessagesAsync(string resourceGroupName, string dedicatedCapacityName, DedicatedCapacity capacityParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + return await innerCapacityOperations + .CreateWithHttpMessagesAsync(resourceGroupName, dedicatedCapacityName, capacityParameters, customHeaders, cancellationToken) + .ConfigureAwait(false); + } + + /// + public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string dedicatedCapacityName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + return await innerCapacityOperations + .DeleteWithHttpMessagesAsync(resourceGroupName, dedicatedCapacityName, customHeaders, cancellationToken) + .ConfigureAwait(false); + } + + /// + /// Customize response return 200 skip LRO operation. -- migration engineer + public async Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string dedicatedCapacityName, DedicatedCapacityUpdateParameters capacityUpdateParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + AzureOperationResponse _response = await BeginUpdateWithHttpMessagesAsync(resourceGroupName, dedicatedCapacityName, capacityUpdateParameters, customHeaders, cancellationToken).ConfigureAwait(false); + if (_response.Response.StatusCode != System.Net.HttpStatusCode.OK) + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + return _response; + } + + /// + public async Task SuspendWithHttpMessagesAsync(string resourceGroupName, string dedicatedCapacityName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + return await innerCapacityOperations + .SuspendWithHttpMessagesAsync(resourceGroupName, dedicatedCapacityName, customHeaders, cancellationToken) + .ConfigureAwait(false); + } + + /// + public async Task ResumeWithHttpMessagesAsync(string resourceGroupName, string dedicatedCapacityName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + return await innerCapacityOperations + .ResumeWithHttpMessagesAsync(resourceGroupName, dedicatedCapacityName, customHeaders, cancellationToken) + .ConfigureAwait(false); + } + + /// + public async Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + return await innerCapacityOperations + .ListByResourceGroupWithHttpMessagesAsync(resourceGroupName, customHeaders, cancellationToken) + .ConfigureAwait(false); + } + + /// + public async Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + return await innerCapacityOperations + .ListWithHttpMessagesAsync(customHeaders, cancellationToken) + .ConfigureAwait(false); + } + + /// + public async Task> ListSkusWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + return await innerCapacityOperations + .ListSkusWithHttpMessagesAsync(customHeaders, cancellationToken) + .ConfigureAwait(false); + } + + /// + public async Task> ListSkusForCapacityWithHttpMessagesAsync(string resourceGroupName, string dedicatedCapacityName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + return await innerCapacityOperations + .ListSkusForCapacityWithHttpMessagesAsync(resourceGroupName, dedicatedCapacityName, customHeaders, cancellationToken) + .ConfigureAwait(false); + } + + /// + public async Task> BeginCreateWithHttpMessagesAsync(string resourceGroupName, string dedicatedCapacityName, DedicatedCapacity capacityParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + return await innerCapacityOperations + .BeginCreateWithHttpMessagesAsync(resourceGroupName, dedicatedCapacityName, capacityParameters, customHeaders, cancellationToken) + .ConfigureAwait(false); + } + + /// + public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string dedicatedCapacityName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + return await innerCapacityOperations + .BeginDeleteWithHttpMessagesAsync(resourceGroupName, dedicatedCapacityName, customHeaders, cancellationToken) + .ConfigureAwait(false); + } + + /// + public async Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string dedicatedCapacityName, DedicatedCapacityUpdateParameters capacityUpdateParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + return await innerCapacityOperations + .BeginUpdateWithHttpMessagesAsync(resourceGroupName, dedicatedCapacityName, capacityUpdateParameters, customHeaders, cancellationToken) + .ConfigureAwait(false); + } + + /// + public async Task BeginSuspendWithHttpMessagesAsync(string resourceGroupName, string dedicatedCapacityName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + return await innerCapacityOperations + .BeginSuspendWithHttpMessagesAsync(resourceGroupName, dedicatedCapacityName, customHeaders, cancellationToken) + .ConfigureAwait(false); + } + + /// + public async Task BeginResumeWithHttpMessagesAsync(string resourceGroupName, string dedicatedCapacityName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + return await innerCapacityOperations + .BeginResumeWithHttpMessagesAsync(resourceGroupName, dedicatedCapacityName, customHeaders, cancellationToken) + .ConfigureAwait(false); + } + } +} \ No newline at end of file diff --git a/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/CapacitiesOperations.cs b/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/CapacitiesOperations.cs new file mode 100644 index 000000000000..927c2afbfbe8 --- /dev/null +++ b/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/CapacitiesOperations.cs @@ -0,0 +1,2355 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.PowerBIDedicated +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// CapacitiesOperations operations. + /// + internal partial class CapacitiesOperations : IServiceOperations, ICapacitiesOperations + { + /// + /// Initializes a new instance of the CapacitiesOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal CapacitiesOperations(PowerBIDedicatedManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the PowerBIDedicatedManagementClient + /// + public PowerBIDedicatedManagementClient Client { get; private set; } + + /// + /// Gets details about the specified dedicated capacity. + /// + /// + /// The name of the Azure Resource group of which a given PowerBIDedicated + /// capacity is part. This name must be at least 1 character in length, and no + /// more than 90. + /// + /// + /// The name of the dedicated capacity. It must be a minimum of 3 characters, + /// and a maximum of 63. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetDetailsWithHttpMessagesAsync(string resourceGroupName, string dedicatedCapacityName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } + } + if (dedicatedCapacityName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "dedicatedCapacityName"); + } + if (dedicatedCapacityName != null) + { + if (dedicatedCapacityName.Length > 63) + { + throw new ValidationException(ValidationRules.MaxLength, "dedicatedCapacityName", 63); + } + if (dedicatedCapacityName.Length < 3) + { + throw new ValidationException(ValidationRules.MinLength, "dedicatedCapacityName", 3); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(dedicatedCapacityName, "^[a-z][a-z0-9]*$")) + { + throw new ValidationException(ValidationRules.Pattern, "dedicatedCapacityName", "^[a-z][a-z0-9]*$"); + } + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("dedicatedCapacityName", dedicatedCapacityName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "GetDetails", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBIDedicated/capacities/{dedicatedCapacityName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{dedicatedCapacityName}", System.Uri.EscapeDataString(dedicatedCapacityName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Provisions the specified Dedicated capacity based on the configuration + /// specified in the request. + /// + /// + /// The name of the Azure Resource group of which a given PowerBIDedicated + /// capacity is part. This name must be at least 1 character in length, and no + /// more than 90. + /// + /// + /// The name of the Dedicated capacity. It must be a minimum of 3 characters, + /// and a maximum of 63. + /// + /// + /// Contains the information used to provision the Dedicated capacity. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> CreateWithHttpMessagesAsync(string resourceGroupName, string dedicatedCapacityName, DedicatedCapacity capacityParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginCreateWithHttpMessagesAsync(resourceGroupName, dedicatedCapacityName, capacityParameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Deletes the specified Dedicated capacity. + /// + /// + /// The name of the Azure Resource group of which a given PowerBIDedicated + /// capacity is part. This name must be at least 1 character in length, and no + /// more than 90. + /// + /// + /// The name of the Dedicated capacity. It must be at least 3 characters in + /// length, and no more than 63. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string dedicatedCapacityName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, dedicatedCapacityName, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Updates the current state of the specified Dedicated capacity. + /// + /// + /// The name of the Azure Resource group of which a given PowerBIDedicated + /// capacity is part. This name must be at least 1 character in length, and no + /// more than 90. + /// + /// + /// The name of the Dedicated capacity. It must be at least 3 characters in + /// length, and no more than 63. + /// + /// + /// Request object that contains the updated information for the capacity. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string dedicatedCapacityName, DedicatedCapacityUpdateParameters capacityUpdateParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginUpdateWithHttpMessagesAsync(resourceGroupName, dedicatedCapacityName, capacityUpdateParameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Suspends operation of the specified dedicated capacity instance. + /// + /// + /// The name of the Azure Resource group of which a given PowerBIDedicated + /// capacity is part. This name must be at least 1 character in length, and no + /// more than 90. + /// + /// + /// The name of the Dedicated capacity. It must be at least 3 characters in + /// length, and no more than 63. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task SuspendWithHttpMessagesAsync(string resourceGroupName, string dedicatedCapacityName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginSuspendWithHttpMessagesAsync(resourceGroupName, dedicatedCapacityName, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Resumes operation of the specified Dedicated capacity instance. + /// + /// + /// The name of the Azure Resource group of which a given PowerBIDedicated + /// capacity is part. This name must be at least 1 character in length, and no + /// more than 90. + /// + /// + /// The name of the Dedicated capacity. It must be at least 3 characters in + /// length, and no more than 63. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task ResumeWithHttpMessagesAsync(string resourceGroupName, string dedicatedCapacityName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginResumeWithHttpMessagesAsync(resourceGroupName, dedicatedCapacityName, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets all the Dedicated capacities for the given resource group. + /// + /// + /// The name of the Azure Resource group of which a given PowerBIDedicated + /// capacity is part. This name must be at least 1 character in length, and no + /// more than 90. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroup", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBIDedicated/capacities").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Lists all the Dedicated capacities for the given subscription. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.PowerBIDedicated/capacities").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Lists eligible SKUs for PowerBI Dedicated resource provider. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> ListSkusWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListSkus", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.PowerBIDedicated/skus").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Lists eligible SKUs for a PowerBI Dedicated resource. + /// + /// + /// The name of the Azure Resource group of which a given PowerBIDedicated + /// capacity is part. This name must be at least 1 character in length, and no + /// more than 90. + /// + /// + /// The name of the Dedicated capacity. It must be at least 3 characters in + /// length, and no more than 63. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> ListSkusForCapacityWithHttpMessagesAsync(string resourceGroupName, string dedicatedCapacityName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } + } + if (dedicatedCapacityName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "dedicatedCapacityName"); + } + if (dedicatedCapacityName != null) + { + if (dedicatedCapacityName.Length > 63) + { + throw new ValidationException(ValidationRules.MaxLength, "dedicatedCapacityName", 63); + } + if (dedicatedCapacityName.Length < 3) + { + throw new ValidationException(ValidationRules.MinLength, "dedicatedCapacityName", 3); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(dedicatedCapacityName, "^[a-z][a-z0-9]*$")) + { + throw new ValidationException(ValidationRules.Pattern, "dedicatedCapacityName", "^[a-z][a-z0-9]*$"); + } + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("dedicatedCapacityName", dedicatedCapacityName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListSkusForCapacity", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBIDedicated/capacities/{dedicatedCapacityName}/skus").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{dedicatedCapacityName}", System.Uri.EscapeDataString(dedicatedCapacityName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Provisions the specified Dedicated capacity based on the configuration + /// specified in the request. + /// + /// + /// The name of the Azure Resource group of which a given PowerBIDedicated + /// capacity is part. This name must be at least 1 character in length, and no + /// more than 90. + /// + /// + /// The name of the Dedicated capacity. It must be a minimum of 3 characters, + /// and a maximum of 63. + /// + /// + /// Contains the information used to provision the Dedicated capacity. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> BeginCreateWithHttpMessagesAsync(string resourceGroupName, string dedicatedCapacityName, DedicatedCapacity capacityParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } + } + if (dedicatedCapacityName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "dedicatedCapacityName"); + } + if (dedicatedCapacityName != null) + { + if (dedicatedCapacityName.Length > 63) + { + throw new ValidationException(ValidationRules.MaxLength, "dedicatedCapacityName", 63); + } + if (dedicatedCapacityName.Length < 3) + { + throw new ValidationException(ValidationRules.MinLength, "dedicatedCapacityName", 3); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(dedicatedCapacityName, "^[a-z][a-z0-9]*$")) + { + throw new ValidationException(ValidationRules.Pattern, "dedicatedCapacityName", "^[a-z][a-z0-9]*$"); + } + } + if (capacityParameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "capacityParameters"); + } + if (capacityParameters != null) + { + capacityParameters.Validate(); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("dedicatedCapacityName", dedicatedCapacityName); + tracingParameters.Add("capacityParameters", capacityParameters); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreate", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBIDedicated/capacities/{dedicatedCapacityName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{dedicatedCapacityName}", System.Uri.EscapeDataString(dedicatedCapacityName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(capacityParameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(capacityParameters, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 201) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Deletes the specified Dedicated capacity. + /// + /// + /// The name of the Azure Resource group of which a given PowerBIDedicated + /// capacity is part. This name must be at least 1 character in length, and no + /// more than 90. + /// + /// + /// The name of the Dedicated capacity. It must be at least 3 characters in + /// length, and no more than 63. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string dedicatedCapacityName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } + } + if (dedicatedCapacityName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "dedicatedCapacityName"); + } + if (dedicatedCapacityName != null) + { + if (dedicatedCapacityName.Length > 63) + { + throw new ValidationException(ValidationRules.MaxLength, "dedicatedCapacityName", 63); + } + if (dedicatedCapacityName.Length < 3) + { + throw new ValidationException(ValidationRules.MinLength, "dedicatedCapacityName", 3); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(dedicatedCapacityName, "^[a-z][a-z0-9]*$")) + { + throw new ValidationException(ValidationRules.Pattern, "dedicatedCapacityName", "^[a-z][a-z0-9]*$"); + } + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("dedicatedCapacityName", dedicatedCapacityName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBIDedicated/capacities/{dedicatedCapacityName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{dedicatedCapacityName}", System.Uri.EscapeDataString(dedicatedCapacityName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Updates the current state of the specified Dedicated capacity. + /// + /// + /// The name of the Azure Resource group of which a given PowerBIDedicated + /// capacity is part. This name must be at least 1 character in length, and no + /// more than 90. + /// + /// + /// The name of the Dedicated capacity. It must be at least 3 characters in + /// length, and no more than 63. + /// + /// + /// Request object that contains the updated information for the capacity. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string dedicatedCapacityName, DedicatedCapacityUpdateParameters capacityUpdateParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } + } + if (dedicatedCapacityName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "dedicatedCapacityName"); + } + if (dedicatedCapacityName != null) + { + if (dedicatedCapacityName.Length > 63) + { + throw new ValidationException(ValidationRules.MaxLength, "dedicatedCapacityName", 63); + } + if (dedicatedCapacityName.Length < 3) + { + throw new ValidationException(ValidationRules.MinLength, "dedicatedCapacityName", 3); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(dedicatedCapacityName, "^[a-z][a-z0-9]*$")) + { + throw new ValidationException(ValidationRules.Pattern, "dedicatedCapacityName", "^[a-z][a-z0-9]*$"); + } + } + if (capacityUpdateParameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "capacityUpdateParameters"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("dedicatedCapacityName", dedicatedCapacityName); + tracingParameters.Add("capacityUpdateParameters", capacityUpdateParameters); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginUpdate", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBIDedicated/capacities/{dedicatedCapacityName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{dedicatedCapacityName}", System.Uri.EscapeDataString(dedicatedCapacityName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PATCH"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(capacityUpdateParameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(capacityUpdateParameters, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 202) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Suspends operation of the specified dedicated capacity instance. + /// + /// + /// The name of the Azure Resource group of which a given PowerBIDedicated + /// capacity is part. This name must be at least 1 character in length, and no + /// more than 90. + /// + /// + /// The name of the Dedicated capacity. It must be at least 3 characters in + /// length, and no more than 63. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task BeginSuspendWithHttpMessagesAsync(string resourceGroupName, string dedicatedCapacityName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } + } + if (dedicatedCapacityName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "dedicatedCapacityName"); + } + if (dedicatedCapacityName != null) + { + if (dedicatedCapacityName.Length > 63) + { + throw new ValidationException(ValidationRules.MaxLength, "dedicatedCapacityName", 63); + } + if (dedicatedCapacityName.Length < 3) + { + throw new ValidationException(ValidationRules.MinLength, "dedicatedCapacityName", 3); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(dedicatedCapacityName, "^[a-z][a-z0-9]*$")) + { + throw new ValidationException(ValidationRules.Pattern, "dedicatedCapacityName", "^[a-z][a-z0-9]*$"); + } + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("dedicatedCapacityName", dedicatedCapacityName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginSuspend", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBIDedicated/capacities/{dedicatedCapacityName}/suspend").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{dedicatedCapacityName}", System.Uri.EscapeDataString(dedicatedCapacityName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Resumes operation of the specified Dedicated capacity instance. + /// + /// + /// The name of the Azure Resource group of which a given PowerBIDedicated + /// capacity is part. This name must be at least 1 character in length, and no + /// more than 90. + /// + /// + /// The name of the Dedicated capacity. It must be at least 3 characters in + /// length, and no more than 63. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task BeginResumeWithHttpMessagesAsync(string resourceGroupName, string dedicatedCapacityName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } + } + if (dedicatedCapacityName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "dedicatedCapacityName"); + } + if (dedicatedCapacityName != null) + { + if (dedicatedCapacityName.Length > 63) + { + throw new ValidationException(ValidationRules.MaxLength, "dedicatedCapacityName", 63); + } + if (dedicatedCapacityName.Length < 3) + { + throw new ValidationException(ValidationRules.MinLength, "dedicatedCapacityName", 3); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(dedicatedCapacityName, "^[a-z][a-z0-9]*$")) + { + throw new ValidationException(ValidationRules.Pattern, "dedicatedCapacityName", "^[a-z][a-z0-9]*$"); + } + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("dedicatedCapacityName", dedicatedCapacityName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginResume", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBIDedicated/capacities/{dedicatedCapacityName}/resume").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{dedicatedCapacityName}", System.Uri.EscapeDataString(dedicatedCapacityName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/CapacitiesOperationsExtensions.cs b/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/CapacitiesOperationsExtensions.cs new file mode 100644 index 000000000000..10a9a5f779ef --- /dev/null +++ b/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/CapacitiesOperationsExtensions.cs @@ -0,0 +1,683 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.PowerBIDedicated +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for CapacitiesOperations. + /// + public static partial class CapacitiesOperationsExtensions + { + /// + /// Gets details about the specified dedicated capacity. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the Azure Resource group of which a given PowerBIDedicated + /// capacity is part. This name must be at least 1 character in length, and no + /// more than 90. + /// + /// + /// The name of the dedicated capacity. It must be a minimum of 3 characters, + /// and a maximum of 63. + /// + public static DedicatedCapacity GetDetails(this ICapacitiesOperations operations, string resourceGroupName, string dedicatedCapacityName) + { + return operations.GetDetailsAsync(resourceGroupName, dedicatedCapacityName).GetAwaiter().GetResult(); + } + + /// + /// Gets details about the specified dedicated capacity. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the Azure Resource group of which a given PowerBIDedicated + /// capacity is part. This name must be at least 1 character in length, and no + /// more than 90. + /// + /// + /// The name of the dedicated capacity. It must be a minimum of 3 characters, + /// and a maximum of 63. + /// + /// + /// The cancellation token. + /// + public static async Task GetDetailsAsync(this ICapacitiesOperations operations, string resourceGroupName, string dedicatedCapacityName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetDetailsWithHttpMessagesAsync(resourceGroupName, dedicatedCapacityName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Provisions the specified Dedicated capacity based on the configuration + /// specified in the request. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the Azure Resource group of which a given PowerBIDedicated + /// capacity is part. This name must be at least 1 character in length, and no + /// more than 90. + /// + /// + /// The name of the Dedicated capacity. It must be a minimum of 3 characters, + /// and a maximum of 63. + /// + /// + /// Contains the information used to provision the Dedicated capacity. + /// + public static DedicatedCapacity Create(this ICapacitiesOperations operations, string resourceGroupName, string dedicatedCapacityName, DedicatedCapacity capacityParameters) + { + return operations.CreateAsync(resourceGroupName, dedicatedCapacityName, capacityParameters).GetAwaiter().GetResult(); + } + + /// + /// Provisions the specified Dedicated capacity based on the configuration + /// specified in the request. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the Azure Resource group of which a given PowerBIDedicated + /// capacity is part. This name must be at least 1 character in length, and no + /// more than 90. + /// + /// + /// The name of the Dedicated capacity. It must be a minimum of 3 characters, + /// and a maximum of 63. + /// + /// + /// Contains the information used to provision the Dedicated capacity. + /// + /// + /// The cancellation token. + /// + public static async Task CreateAsync(this ICapacitiesOperations operations, string resourceGroupName, string dedicatedCapacityName, DedicatedCapacity capacityParameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.CreateWithHttpMessagesAsync(resourceGroupName, dedicatedCapacityName, capacityParameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Deletes the specified Dedicated capacity. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the Azure Resource group of which a given PowerBIDedicated + /// capacity is part. This name must be at least 1 character in length, and no + /// more than 90. + /// + /// + /// The name of the Dedicated capacity. It must be at least 3 characters in + /// length, and no more than 63. + /// + public static void Delete(this ICapacitiesOperations operations, string resourceGroupName, string dedicatedCapacityName) + { + operations.DeleteAsync(resourceGroupName, dedicatedCapacityName).GetAwaiter().GetResult(); + } + + /// + /// Deletes the specified Dedicated capacity. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the Azure Resource group of which a given PowerBIDedicated + /// capacity is part. This name must be at least 1 character in length, and no + /// more than 90. + /// + /// + /// The name of the Dedicated capacity. It must be at least 3 characters in + /// length, and no more than 63. + /// + /// + /// The cancellation token. + /// + public static async Task DeleteAsync(this ICapacitiesOperations operations, string resourceGroupName, string dedicatedCapacityName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, dedicatedCapacityName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Updates the current state of the specified Dedicated capacity. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the Azure Resource group of which a given PowerBIDedicated + /// capacity is part. This name must be at least 1 character in length, and no + /// more than 90. + /// + /// + /// The name of the Dedicated capacity. It must be at least 3 characters in + /// length, and no more than 63. + /// + /// + /// Request object that contains the updated information for the capacity. + /// + public static DedicatedCapacity Update(this ICapacitiesOperations operations, string resourceGroupName, string dedicatedCapacityName, DedicatedCapacityUpdateParameters capacityUpdateParameters) + { + return operations.UpdateAsync(resourceGroupName, dedicatedCapacityName, capacityUpdateParameters).GetAwaiter().GetResult(); + } + + /// + /// Updates the current state of the specified Dedicated capacity. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the Azure Resource group of which a given PowerBIDedicated + /// capacity is part. This name must be at least 1 character in length, and no + /// more than 90. + /// + /// + /// The name of the Dedicated capacity. It must be at least 3 characters in + /// length, and no more than 63. + /// + /// + /// Request object that contains the updated information for the capacity. + /// + /// + /// The cancellation token. + /// + public static async Task UpdateAsync(this ICapacitiesOperations operations, string resourceGroupName, string dedicatedCapacityName, DedicatedCapacityUpdateParameters capacityUpdateParameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, dedicatedCapacityName, capacityUpdateParameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Suspends operation of the specified dedicated capacity instance. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the Azure Resource group of which a given PowerBIDedicated + /// capacity is part. This name must be at least 1 character in length, and no + /// more than 90. + /// + /// + /// The name of the Dedicated capacity. It must be at least 3 characters in + /// length, and no more than 63. + /// + public static void Suspend(this ICapacitiesOperations operations, string resourceGroupName, string dedicatedCapacityName) + { + operations.SuspendAsync(resourceGroupName, dedicatedCapacityName).GetAwaiter().GetResult(); + } + + /// + /// Suspends operation of the specified dedicated capacity instance. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the Azure Resource group of which a given PowerBIDedicated + /// capacity is part. This name must be at least 1 character in length, and no + /// more than 90. + /// + /// + /// The name of the Dedicated capacity. It must be at least 3 characters in + /// length, and no more than 63. + /// + /// + /// The cancellation token. + /// + public static async Task SuspendAsync(this ICapacitiesOperations operations, string resourceGroupName, string dedicatedCapacityName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.SuspendWithHttpMessagesAsync(resourceGroupName, dedicatedCapacityName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Resumes operation of the specified Dedicated capacity instance. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the Azure Resource group of which a given PowerBIDedicated + /// capacity is part. This name must be at least 1 character in length, and no + /// more than 90. + /// + /// + /// The name of the Dedicated capacity. It must be at least 3 characters in + /// length, and no more than 63. + /// + public static void Resume(this ICapacitiesOperations operations, string resourceGroupName, string dedicatedCapacityName) + { + operations.ResumeAsync(resourceGroupName, dedicatedCapacityName).GetAwaiter().GetResult(); + } + + /// + /// Resumes operation of the specified Dedicated capacity instance. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the Azure Resource group of which a given PowerBIDedicated + /// capacity is part. This name must be at least 1 character in length, and no + /// more than 90. + /// + /// + /// The name of the Dedicated capacity. It must be at least 3 characters in + /// length, and no more than 63. + /// + /// + /// The cancellation token. + /// + public static async Task ResumeAsync(this ICapacitiesOperations operations, string resourceGroupName, string dedicatedCapacityName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.ResumeWithHttpMessagesAsync(resourceGroupName, dedicatedCapacityName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Gets all the Dedicated capacities for the given resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the Azure Resource group of which a given PowerBIDedicated + /// capacity is part. This name must be at least 1 character in length, and no + /// more than 90. + /// + public static IEnumerable ListByResourceGroup(this ICapacitiesOperations operations, string resourceGroupName) + { + return operations.ListByResourceGroupAsync(resourceGroupName).GetAwaiter().GetResult(); + } + + /// + /// Gets all the Dedicated capacities for the given resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the Azure Resource group of which a given PowerBIDedicated + /// capacity is part. This name must be at least 1 character in length, and no + /// more than 90. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByResourceGroupAsync(this ICapacitiesOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByResourceGroupWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Lists all the Dedicated capacities for the given subscription. + /// + /// + /// The operations group for this extension method. + /// + public static IEnumerable List(this ICapacitiesOperations operations) + { + return operations.ListAsync().GetAwaiter().GetResult(); + } + + /// + /// Lists all the Dedicated capacities for the given subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async Task> ListAsync(this ICapacitiesOperations operations, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Lists eligible SKUs for PowerBI Dedicated resource provider. + /// + /// + /// The operations group for this extension method. + /// + public static SkuEnumerationForNewResourceResult ListSkus(this ICapacitiesOperations operations) + { + return operations.ListSkusAsync().GetAwaiter().GetResult(); + } + + /// + /// Lists eligible SKUs for PowerBI Dedicated resource provider. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async Task ListSkusAsync(this ICapacitiesOperations operations, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListSkusWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Lists eligible SKUs for a PowerBI Dedicated resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the Azure Resource group of which a given PowerBIDedicated + /// capacity is part. This name must be at least 1 character in length, and no + /// more than 90. + /// + /// + /// The name of the Dedicated capacity. It must be at least 3 characters in + /// length, and no more than 63. + /// + public static SkuEnumerationForExistingResourceResult ListSkusForCapacity(this ICapacitiesOperations operations, string resourceGroupName, string dedicatedCapacityName) + { + return operations.ListSkusForCapacityAsync(resourceGroupName, dedicatedCapacityName).GetAwaiter().GetResult(); + } + + /// + /// Lists eligible SKUs for a PowerBI Dedicated resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the Azure Resource group of which a given PowerBIDedicated + /// capacity is part. This name must be at least 1 character in length, and no + /// more than 90. + /// + /// + /// The name of the Dedicated capacity. It must be at least 3 characters in + /// length, and no more than 63. + /// + /// + /// The cancellation token. + /// + public static async Task ListSkusForCapacityAsync(this ICapacitiesOperations operations, string resourceGroupName, string dedicatedCapacityName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListSkusForCapacityWithHttpMessagesAsync(resourceGroupName, dedicatedCapacityName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Provisions the specified Dedicated capacity based on the configuration + /// specified in the request. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the Azure Resource group of which a given PowerBIDedicated + /// capacity is part. This name must be at least 1 character in length, and no + /// more than 90. + /// + /// + /// The name of the Dedicated capacity. It must be a minimum of 3 characters, + /// and a maximum of 63. + /// + /// + /// Contains the information used to provision the Dedicated capacity. + /// + public static DedicatedCapacity BeginCreate(this ICapacitiesOperations operations, string resourceGroupName, string dedicatedCapacityName, DedicatedCapacity capacityParameters) + { + return operations.BeginCreateAsync(resourceGroupName, dedicatedCapacityName, capacityParameters).GetAwaiter().GetResult(); + } + + /// + /// Provisions the specified Dedicated capacity based on the configuration + /// specified in the request. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the Azure Resource group of which a given PowerBIDedicated + /// capacity is part. This name must be at least 1 character in length, and no + /// more than 90. + /// + /// + /// The name of the Dedicated capacity. It must be a minimum of 3 characters, + /// and a maximum of 63. + /// + /// + /// Contains the information used to provision the Dedicated capacity. + /// + /// + /// The cancellation token. + /// + public static async Task BeginCreateAsync(this ICapacitiesOperations operations, string resourceGroupName, string dedicatedCapacityName, DedicatedCapacity capacityParameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginCreateWithHttpMessagesAsync(resourceGroupName, dedicatedCapacityName, capacityParameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Deletes the specified Dedicated capacity. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the Azure Resource group of which a given PowerBIDedicated + /// capacity is part. This name must be at least 1 character in length, and no + /// more than 90. + /// + /// + /// The name of the Dedicated capacity. It must be at least 3 characters in + /// length, and no more than 63. + /// + public static void BeginDelete(this ICapacitiesOperations operations, string resourceGroupName, string dedicatedCapacityName) + { + operations.BeginDeleteAsync(resourceGroupName, dedicatedCapacityName).GetAwaiter().GetResult(); + } + + /// + /// Deletes the specified Dedicated capacity. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the Azure Resource group of which a given PowerBIDedicated + /// capacity is part. This name must be at least 1 character in length, and no + /// more than 90. + /// + /// + /// The name of the Dedicated capacity. It must be at least 3 characters in + /// length, and no more than 63. + /// + /// + /// The cancellation token. + /// + public static async Task BeginDeleteAsync(this ICapacitiesOperations operations, string resourceGroupName, string dedicatedCapacityName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, dedicatedCapacityName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Updates the current state of the specified Dedicated capacity. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the Azure Resource group of which a given PowerBIDedicated + /// capacity is part. This name must be at least 1 character in length, and no + /// more than 90. + /// + /// + /// The name of the Dedicated capacity. It must be at least 3 characters in + /// length, and no more than 63. + /// + /// + /// Request object that contains the updated information for the capacity. + /// + public static DedicatedCapacity BeginUpdate(this ICapacitiesOperations operations, string resourceGroupName, string dedicatedCapacityName, DedicatedCapacityUpdateParameters capacityUpdateParameters) + { + return operations.BeginUpdateAsync(resourceGroupName, dedicatedCapacityName, capacityUpdateParameters).GetAwaiter().GetResult(); + } + + /// + /// Updates the current state of the specified Dedicated capacity. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the Azure Resource group of which a given PowerBIDedicated + /// capacity is part. This name must be at least 1 character in length, and no + /// more than 90. + /// + /// + /// The name of the Dedicated capacity. It must be at least 3 characters in + /// length, and no more than 63. + /// + /// + /// Request object that contains the updated information for the capacity. + /// + /// + /// The cancellation token. + /// + public static async Task BeginUpdateAsync(this ICapacitiesOperations operations, string resourceGroupName, string dedicatedCapacityName, DedicatedCapacityUpdateParameters capacityUpdateParameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginUpdateWithHttpMessagesAsync(resourceGroupName, dedicatedCapacityName, capacityUpdateParameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Suspends operation of the specified dedicated capacity instance. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the Azure Resource group of which a given PowerBIDedicated + /// capacity is part. This name must be at least 1 character in length, and no + /// more than 90. + /// + /// + /// The name of the Dedicated capacity. It must be at least 3 characters in + /// length, and no more than 63. + /// + public static void BeginSuspend(this ICapacitiesOperations operations, string resourceGroupName, string dedicatedCapacityName) + { + operations.BeginSuspendAsync(resourceGroupName, dedicatedCapacityName).GetAwaiter().GetResult(); + } + + /// + /// Suspends operation of the specified dedicated capacity instance. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the Azure Resource group of which a given PowerBIDedicated + /// capacity is part. This name must be at least 1 character in length, and no + /// more than 90. + /// + /// + /// The name of the Dedicated capacity. It must be at least 3 characters in + /// length, and no more than 63. + /// + /// + /// The cancellation token. + /// + public static async Task BeginSuspendAsync(this ICapacitiesOperations operations, string resourceGroupName, string dedicatedCapacityName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.BeginSuspendWithHttpMessagesAsync(resourceGroupName, dedicatedCapacityName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Resumes operation of the specified Dedicated capacity instance. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the Azure Resource group of which a given PowerBIDedicated + /// capacity is part. This name must be at least 1 character in length, and no + /// more than 90. + /// + /// + /// The name of the Dedicated capacity. It must be at least 3 characters in + /// length, and no more than 63. + /// + public static void BeginResume(this ICapacitiesOperations operations, string resourceGroupName, string dedicatedCapacityName) + { + operations.BeginResumeAsync(resourceGroupName, dedicatedCapacityName).GetAwaiter().GetResult(); + } + + /// + /// Resumes operation of the specified Dedicated capacity instance. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the Azure Resource group of which a given PowerBIDedicated + /// capacity is part. This name must be at least 1 character in length, and no + /// more than 90. + /// + /// + /// The name of the Dedicated capacity. It must be at least 3 characters in + /// length, and no more than 63. + /// + /// + /// The cancellation token. + /// + public static async Task BeginResumeAsync(this ICapacitiesOperations operations, string resourceGroupName, string dedicatedCapacityName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.BeginResumeWithHttpMessagesAsync(resourceGroupName, dedicatedCapacityName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + } +} diff --git a/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/ICapacitiesOperations.cs b/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/ICapacitiesOperations.cs new file mode 100644 index 000000000000..985174e0c941 --- /dev/null +++ b/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/ICapacitiesOperations.cs @@ -0,0 +1,423 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.PowerBIDedicated +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// CapacitiesOperations operations. + /// + public partial interface ICapacitiesOperations + { + /// + /// Gets details about the specified dedicated capacity. + /// + /// + /// The name of the Azure Resource group of which a given + /// PowerBIDedicated capacity is part. This name must be at least 1 + /// character in length, and no more than 90. + /// + /// + /// The name of the dedicated capacity. It must be a minimum of 3 + /// characters, and a maximum of 63. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetDetailsWithHttpMessagesAsync(string resourceGroupName, string dedicatedCapacityName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Provisions the specified Dedicated capacity based on the + /// configuration specified in the request. + /// + /// + /// The name of the Azure Resource group of which a given + /// PowerBIDedicated capacity is part. This name must be at least 1 + /// character in length, and no more than 90. + /// + /// + /// The name of the Dedicated capacity. It must be a minimum of 3 + /// characters, and a maximum of 63. + /// + /// + /// Contains the information used to provision the Dedicated capacity. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> CreateWithHttpMessagesAsync(string resourceGroupName, string dedicatedCapacityName, DedicatedCapacity capacityParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Deletes the specified Dedicated capacity. + /// + /// + /// The name of the Azure Resource group of which a given + /// PowerBIDedicated capacity is part. This name must be at least 1 + /// character in length, and no more than 90. + /// + /// + /// The name of the Dedicated capacity. It must be at least 3 + /// characters in length, and no more than 63. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task DeleteWithHttpMessagesAsync(string resourceGroupName, string dedicatedCapacityName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Updates the current state of the specified Dedicated capacity. + /// + /// + /// The name of the Azure Resource group of which a given + /// PowerBIDedicated capacity is part. This name must be at least 1 + /// character in length, and no more than 90. + /// + /// + /// The name of the Dedicated capacity. It must be at least 3 + /// characters in length, and no more than 63. + /// + /// + /// Request object that contains the updated information for the + /// capacity. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string dedicatedCapacityName, DedicatedCapacityUpdateParameters capacityUpdateParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Suspends operation of the specified dedicated capacity instance. + /// + /// + /// The name of the Azure Resource group of which a given + /// PowerBIDedicated capacity is part. This name must be at least 1 + /// character in length, and no more than 90. + /// + /// + /// The name of the Dedicated capacity. It must be at least 3 + /// characters in length, and no more than 63. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task SuspendWithHttpMessagesAsync(string resourceGroupName, string dedicatedCapacityName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Resumes operation of the specified Dedicated capacity instance. + /// + /// + /// The name of the Azure Resource group of which a given + /// PowerBIDedicated capacity is part. This name must be at least 1 + /// character in length, and no more than 90. + /// + /// + /// The name of the Dedicated capacity. It must be at least 3 + /// characters in length, and no more than 63. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task ResumeWithHttpMessagesAsync(string resourceGroupName, string dedicatedCapacityName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets all the Dedicated capacities for the given resource group. + /// + /// + /// The name of the Azure Resource group of which a given + /// PowerBIDedicated capacity is part. This name must be at least 1 + /// character in length, and no more than 90. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Lists all the Dedicated capacities for the given subscription. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Lists eligible SKUs for PowerBI Dedicated resource provider. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> ListSkusWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Lists eligible SKUs for a PowerBI Dedicated resource. + /// + /// + /// The name of the Azure Resource group of which a given + /// PowerBIDedicated capacity is part. This name must be at least 1 + /// character in length, and no more than 90. + /// + /// + /// The name of the Dedicated capacity. It must be at least 3 + /// characters in length, and no more than 63. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> ListSkusForCapacityWithHttpMessagesAsync(string resourceGroupName, string dedicatedCapacityName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Provisions the specified Dedicated capacity based on the + /// configuration specified in the request. + /// + /// + /// The name of the Azure Resource group of which a given + /// PowerBIDedicated capacity is part. This name must be at least 1 + /// character in length, and no more than 90. + /// + /// + /// The name of the Dedicated capacity. It must be a minimum of 3 + /// characters, and a maximum of 63. + /// + /// + /// Contains the information used to provision the Dedicated capacity. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> BeginCreateWithHttpMessagesAsync(string resourceGroupName, string dedicatedCapacityName, DedicatedCapacity capacityParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Deletes the specified Dedicated capacity. + /// + /// + /// The name of the Azure Resource group of which a given + /// PowerBIDedicated capacity is part. This name must be at least 1 + /// character in length, and no more than 90. + /// + /// + /// The name of the Dedicated capacity. It must be at least 3 + /// characters in length, and no more than 63. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string dedicatedCapacityName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Updates the current state of the specified Dedicated capacity. + /// + /// + /// The name of the Azure Resource group of which a given + /// PowerBIDedicated capacity is part. This name must be at least 1 + /// character in length, and no more than 90. + /// + /// + /// The name of the Dedicated capacity. It must be at least 3 + /// characters in length, and no more than 63. + /// + /// + /// Request object that contains the updated information for the + /// capacity. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string dedicatedCapacityName, DedicatedCapacityUpdateParameters capacityUpdateParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Suspends operation of the specified dedicated capacity instance. + /// + /// + /// The name of the Azure Resource group of which a given + /// PowerBIDedicated capacity is part. This name must be at least 1 + /// character in length, and no more than 90. + /// + /// + /// The name of the Dedicated capacity. It must be at least 3 + /// characters in length, and no more than 63. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task BeginSuspendWithHttpMessagesAsync(string resourceGroupName, string dedicatedCapacityName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Resumes operation of the specified Dedicated capacity instance. + /// + /// + /// The name of the Azure Resource group of which a given + /// PowerBIDedicated capacity is part. This name must be at least 1 + /// character in length, and no more than 90. + /// + /// + /// The name of the Dedicated capacity. It must be at least 3 + /// characters in length, and no more than 63. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task BeginResumeWithHttpMessagesAsync(string resourceGroupName, string dedicatedCapacityName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/IOperations.cs b/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/IOperations.cs new file mode 100644 index 000000000000..ba6a40caea46 --- /dev/null +++ b/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/IOperations.cs @@ -0,0 +1,68 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.PowerBIDedicated +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Operations operations. + /// + public partial interface IOperations + { + /// + /// Lists all of the available PowerBIDedicated REST API operations. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Lists all of the available PowerBIDedicated REST API operations. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/IPowerBIDedicatedManagementClient.cs b/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/IPowerBIDedicatedManagementClient.cs new file mode 100644 index 000000000000..46ceca37c946 --- /dev/null +++ b/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/IPowerBIDedicatedManagementClient.cs @@ -0,0 +1,86 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.PowerBIDedicated +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + + /// + /// PowerBI Dedicated Web API provides a RESTful set of web services that + /// enables users to create, retrieve, update, and delete Power BI + /// dedicated capacities + /// + public partial interface IPowerBIDedicatedManagementClient : System.IDisposable + { + /// + /// The base URI of the service. + /// + System.Uri BaseUri { get; set; } + + /// + /// Gets or sets json serialization settings. + /// + JsonSerializerSettings SerializationSettings { get; } + + /// + /// Gets or sets json deserialization settings. + /// + JsonSerializerSettings DeserializationSettings { get; } + + /// + /// Credentials needed for the client to connect to Azure. + /// + ServiceClientCredentials Credentials { get; } + + /// + /// A unique identifier for a Microsoft Azure subscription. The + /// subscription ID forms part of the URI for every service call. + /// + string SubscriptionId { get; set; } + + /// + /// The client API version. + /// + string ApiVersion { get; } + + /// + /// The preferred language for the response. + /// + string AcceptLanguage { get; set; } + + /// + /// The retry timeout in seconds for Long Running Operations. Default + /// value is 30. + /// + int? LongRunningOperationRetryTimeout { get; set; } + + /// + /// Whether a unique x-ms-client-request-id should be generated. When + /// set to true a unique x-ms-client-request-id value is generated and + /// included in each request. Default is true. + /// + bool? GenerateClientRequestId { get; set; } + + + /// + /// Gets the ICapacitiesOperations. + /// + ICapacitiesOperations Capacities { get; } + + /// + /// Gets the IOperations. + /// + IOperations Operations { get; } + + } +} diff --git a/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/Models/DedicatedCapacity.cs b/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/Models/DedicatedCapacity.cs new file mode 100644 index 000000000000..0fec40850ab1 --- /dev/null +++ b/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/Models/DedicatedCapacity.cs @@ -0,0 +1,113 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.PowerBIDedicated.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Represents an instance of a Dedicated Capacity resource. + /// + [Rest.Serialization.JsonTransformation] + public partial class DedicatedCapacity : Resource + { + /// + /// Initializes a new instance of the DedicatedCapacity class. + /// + public DedicatedCapacity() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the DedicatedCapacity class. + /// + /// Location of the PowerBI Dedicated + /// resource. + /// The SKU of the PowerBI Dedicated + /// resource. + /// An identifier that represents the PowerBI + /// Dedicated resource. + /// The name of the PowerBI Dedicated + /// resource. + /// The type of the PowerBI Dedicated + /// resource. + /// Key-value pairs of additional resource + /// provisioning properties. + /// A collection of Dedicated capacity + /// administrators + /// The current state of PowerBI Dedicated + /// resource. The state is to indicate more states outside of resource + /// provisioning. Possible values include: 'Deleting', 'Succeeded', + /// 'Failed', 'Paused', 'Suspended', 'Provisioning', 'Updating', + /// 'Suspending', 'Pausing', 'Resuming', 'Preparing', 'Scaling' + /// The current deployment state of + /// PowerBI Dedicatedresource. The provisioningState is to indicate + /// states for resource provisioning. Possible values include: + /// 'Deleting', 'Succeeded', 'Failed', 'Paused', 'Suspended', + /// 'Provisioning', 'Updating', 'Suspending', 'Pausing', 'Resuming', + /// 'Preparing', 'Scaling' + public DedicatedCapacity(string location, ResourceSku sku, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), DedicatedCapacityAdministrators administration = default(DedicatedCapacityAdministrators), string state = default(string), string provisioningState = default(string)) + : base(location, sku, id, name, type, tags) + { + Administration = administration; + State = state; + ProvisioningState = provisioningState; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets a collection of Dedicated capacity administrators + /// + [JsonProperty(PropertyName = "properties.administration")] + public DedicatedCapacityAdministrators Administration { get; set; } + + /// + /// Gets the current state of PowerBI Dedicated resource. The state is + /// to indicate more states outside of resource provisioning. Possible + /// values include: 'Deleting', 'Succeeded', 'Failed', 'Paused', + /// 'Suspended', 'Provisioning', 'Updating', 'Suspending', 'Pausing', + /// 'Resuming', 'Preparing', 'Scaling' + /// + [JsonProperty(PropertyName = "properties.state")] + public string State { get; private set; } + + /// + /// Gets the current deployment state of PowerBI Dedicatedresource. The + /// provisioningState is to indicate states for resource provisioning. + /// Possible values include: 'Deleting', 'Succeeded', 'Failed', + /// 'Paused', 'Suspended', 'Provisioning', 'Updating', 'Suspending', + /// 'Pausing', 'Resuming', 'Preparing', 'Scaling' + /// + [JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState { get; private set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public override void Validate() + { + base.Validate(); + } + } +} diff --git a/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/Models/DedicatedCapacityAdministrators.cs b/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/Models/DedicatedCapacityAdministrators.cs new file mode 100644 index 000000000000..0bb98597b459 --- /dev/null +++ b/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/Models/DedicatedCapacityAdministrators.cs @@ -0,0 +1,56 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.PowerBIDedicated.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// An array of administrator user identities + /// + public partial class DedicatedCapacityAdministrators + { + /// + /// Initializes a new instance of the DedicatedCapacityAdministrators + /// class. + /// + public DedicatedCapacityAdministrators() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the DedicatedCapacityAdministrators + /// class. + /// + /// An array of administrator user + /// identities. + public DedicatedCapacityAdministrators(IList members = default(IList)) + { + Members = members; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets an array of administrator user identities. + /// + [JsonProperty(PropertyName = "members")] + public IList Members { get; set; } + + } +} diff --git a/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/Models/DedicatedCapacityUpdateParameters.cs b/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/Models/DedicatedCapacityUpdateParameters.cs new file mode 100644 index 000000000000..72381dbcc672 --- /dev/null +++ b/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/Models/DedicatedCapacityUpdateParameters.cs @@ -0,0 +1,90 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.PowerBIDedicated.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Provision request specification + /// + [Rest.Serialization.JsonTransformation] + public partial class DedicatedCapacityUpdateParameters + { + /// + /// Initializes a new instance of the DedicatedCapacityUpdateParameters + /// class. + /// + public DedicatedCapacityUpdateParameters() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the DedicatedCapacityUpdateParameters + /// class. + /// + /// The SKU of the Dedicated capacity + /// resource. + /// Key-value pairs of additional provisioning + /// properties. + /// A collection of Dedicated capacity + /// administrators + public DedicatedCapacityUpdateParameters(ResourceSku sku = default(ResourceSku), IDictionary tags = default(IDictionary), DedicatedCapacityAdministrators administration = default(DedicatedCapacityAdministrators)) + { + Sku = sku; + Tags = tags; + Administration = administration; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the SKU of the Dedicated capacity resource. + /// + [JsonProperty(PropertyName = "sku")] + public ResourceSku Sku { get; set; } + + /// + /// Gets or sets key-value pairs of additional provisioning properties. + /// + [JsonProperty(PropertyName = "tags")] + public IDictionary Tags { get; set; } + + /// + /// Gets or sets a collection of Dedicated capacity administrators + /// + [JsonProperty(PropertyName = "properties.administration")] + public DedicatedCapacityAdministrators Administration { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Sku != null) + { + Sku.Validate(); + } + } + } +} diff --git a/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/Models/ErrorResponse.cs b/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/Models/ErrorResponse.cs new file mode 100644 index 000000000000..cdecd42c60a4 --- /dev/null +++ b/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/Models/ErrorResponse.cs @@ -0,0 +1,60 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.PowerBIDedicated.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Describes the format of Error response. + /// + public partial class ErrorResponse + { + /// + /// Initializes a new instance of the ErrorResponse class. + /// + public ErrorResponse() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ErrorResponse class. + /// + /// Error code + /// Error message indicating why the operation + /// failed. + public ErrorResponse(string code = default(string), string message = default(string)) + { + Code = code; + Message = message; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets error code + /// + [JsonProperty(PropertyName = "code")] + public string Code { get; set; } + + /// + /// Gets or sets error message indicating why the operation failed. + /// + [JsonProperty(PropertyName = "message")] + public string Message { get; set; } + + } +} diff --git a/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/Models/ErrorResponseException.cs b/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/Models/ErrorResponseException.cs new file mode 100644 index 000000000000..cfd05966349c --- /dev/null +++ b/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/Models/ErrorResponseException.cs @@ -0,0 +1,62 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.PowerBIDedicated.Models +{ + using Microsoft.Rest; + + /// + /// Exception thrown for an invalid response with ErrorResponse + /// information. + /// + public partial class ErrorResponseException : RestException + { + /// + /// Gets information about the associated HTTP request. + /// + public HttpRequestMessageWrapper Request { get; set; } + + /// + /// Gets information about the associated HTTP response. + /// + public HttpResponseMessageWrapper Response { get; set; } + + /// + /// Gets or sets the body object. + /// + public ErrorResponse Body { get; set; } + + /// + /// Initializes a new instance of the ErrorResponseException class. + /// + public ErrorResponseException() + { + } + + /// + /// Initializes a new instance of the ErrorResponseException class. + /// + /// The exception message. + public ErrorResponseException(string message) + : this(message, null) + { + } + + /// + /// Initializes a new instance of the ErrorResponseException class. + /// + /// The exception message. + /// Inner exception. + public ErrorResponseException(string message, System.Exception innerException) + : base(message, innerException) + { + } + } +} diff --git a/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/Models/Operation.cs b/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/Models/Operation.cs new file mode 100644 index 000000000000..9b3aa76597e4 --- /dev/null +++ b/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/Models/Operation.cs @@ -0,0 +1,61 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.PowerBIDedicated.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Capacities REST API operation. + /// + public partial class Operation + { + /// + /// Initializes a new instance of the Operation class. + /// + public Operation() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the Operation class. + /// + /// Operation name: + /// {provider}/{resource}/{operation}. + /// The object that represents the + /// operation. + public Operation(string name = default(string), OperationDisplay display = default(OperationDisplay)) + { + Name = name; + Display = display; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets operation name: {provider}/{resource}/{operation}. + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; private set; } + + /// + /// Gets or sets the object that represents the operation. + /// + [JsonProperty(PropertyName = "display")] + public OperationDisplay Display { get; set; } + + } +} diff --git a/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/Models/OperationDisplay.cs b/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/Models/OperationDisplay.cs new file mode 100644 index 000000000000..ab9378af4e1c --- /dev/null +++ b/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/Models/OperationDisplay.cs @@ -0,0 +1,70 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.PowerBIDedicated.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// The object that represents the operation. + /// + public partial class OperationDisplay + { + /// + /// Initializes a new instance of the OperationDisplay class. + /// + public OperationDisplay() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the OperationDisplay class. + /// + /// Service provider: + /// Microsoft.PowerBIDedicated. + /// Resource on which the operation is + /// performed: capacity, etc. + /// Operation type: create, update, delete, + /// etc. + public OperationDisplay(string provider = default(string), string resource = default(string), string operation = default(string)) + { + Provider = provider; + Resource = resource; + Operation = operation; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets service provider: Microsoft.PowerBIDedicated. + /// + [JsonProperty(PropertyName = "provider")] + public string Provider { get; private set; } + + /// + /// Gets resource on which the operation is performed: capacity, etc. + /// + [JsonProperty(PropertyName = "resource")] + public string Resource { get; private set; } + + /// + /// Gets operation type: create, update, delete, etc. + /// + [JsonProperty(PropertyName = "operation")] + public string Operation { get; private set; } + + } +} diff --git a/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/Models/Page.cs b/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/Models/Page.cs new file mode 100644 index 000000000000..e42e9a070292 --- /dev/null +++ b/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/Models/Page.cs @@ -0,0 +1,53 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.PowerBIDedicated.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + + /// + /// Defines a page in Azure responses. + /// + /// Type of the page content items + [JsonObject] + public class Page : IPage + { + /// + /// Gets the link to the next page. + /// + [JsonProperty("")] + public string NextPageLink { get; private set; } + + [JsonProperty("value")] + private IList Items{ get; set; } + + /// + /// Returns an enumerator that iterates through the collection. + /// + /// A an enumerator that can be used to iterate through the collection. + public IEnumerator GetEnumerator() + { + return Items == null ? System.Linq.Enumerable.Empty().GetEnumerator() : Items.GetEnumerator(); + } + + /// + /// Returns an enumerator that iterates through the collection. + /// + /// A an enumerator that can be used to iterate through the collection. + IEnumerator IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } + } +} diff --git a/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/Models/Page1.cs b/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/Models/Page1.cs new file mode 100644 index 000000000000..b8b0151a7c29 --- /dev/null +++ b/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/Models/Page1.cs @@ -0,0 +1,53 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.PowerBIDedicated.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + + /// + /// Defines a page in Azure responses. + /// + /// Type of the page content items + [JsonObject] + public class Page1 : IPage + { + /// + /// Gets the link to the next page. + /// + [JsonProperty("nextLink")] + public string NextPageLink { get; private set; } + + [JsonProperty("value")] + private IList Items{ get; set; } + + /// + /// Returns an enumerator that iterates through the collection. + /// + /// A an enumerator that can be used to iterate through the collection. + public IEnumerator GetEnumerator() + { + return Items == null ? System.Linq.Enumerable.Empty().GetEnumerator() : Items.GetEnumerator(); + } + + /// + /// Returns an enumerator that iterates through the collection. + /// + /// A an enumerator that can be used to iterate through the collection. + IEnumerator IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } + } +} diff --git a/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/Models/ProvisioningState.cs b/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/Models/ProvisioningState.cs new file mode 100644 index 000000000000..7296bd306616 --- /dev/null +++ b/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/Models/ProvisioningState.cs @@ -0,0 +1,32 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.PowerBIDedicated.Models +{ + + /// + /// Defines values for ProvisioningState. + /// + public static class ProvisioningState + { + public const string Deleting = "Deleting"; + public const string Succeeded = "Succeeded"; + public const string Failed = "Failed"; + public const string Paused = "Paused"; + public const string Suspended = "Suspended"; + public const string Provisioning = "Provisioning"; + public const string Updating = "Updating"; + public const string Suspending = "Suspending"; + public const string Pausing = "Pausing"; + public const string Resuming = "Resuming"; + public const string Preparing = "Preparing"; + public const string Scaling = "Scaling"; + } +} diff --git a/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/Models/Resource.cs b/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/Models/Resource.cs new file mode 100644 index 000000000000..b17cd1ef1108 --- /dev/null +++ b/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/Models/Resource.cs @@ -0,0 +1,123 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.PowerBIDedicated.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Represents an instance of an PowerBI Dedicated resource. + /// + public partial class Resource : IResource + { + /// + /// Initializes a new instance of the Resource class. + /// + public Resource() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the Resource class. + /// + /// Location of the PowerBI Dedicated + /// resource. + /// The SKU of the PowerBI Dedicated + /// resource. + /// An identifier that represents the PowerBI + /// Dedicated resource. + /// The name of the PowerBI Dedicated + /// resource. + /// The type of the PowerBI Dedicated + /// resource. + /// Key-value pairs of additional resource + /// provisioning properties. + public Resource(string location, ResourceSku sku, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary)) + { + Id = id; + Name = name; + Type = type; + Location = location; + Sku = sku; + Tags = tags; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets an identifier that represents the PowerBI Dedicated resource. + /// + [JsonProperty(PropertyName = "id")] + public string Id { get; private set; } + + /// + /// Gets the name of the PowerBI Dedicated resource. + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; private set; } + + /// + /// Gets the type of the PowerBI Dedicated resource. + /// + [JsonProperty(PropertyName = "type")] + public string Type { get; private set; } + + /// + /// Gets or sets location of the PowerBI Dedicated resource. + /// + [JsonProperty(PropertyName = "location")] + public string Location { get; set; } + + /// + /// Gets or sets the SKU of the PowerBI Dedicated resource. + /// + [JsonProperty(PropertyName = "sku")] + public ResourceSku Sku { get; set; } + + /// + /// Gets or sets key-value pairs of additional resource provisioning + /// properties. + /// + [JsonProperty(PropertyName = "tags")] + public IDictionary Tags { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Location == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Location"); + } + if (Sku == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Sku"); + } + if (Sku != null) + { + Sku.Validate(); + } + } + } +} diff --git a/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/Models/ResourceSku.cs b/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/Models/ResourceSku.cs new file mode 100644 index 000000000000..1518b79bdd06 --- /dev/null +++ b/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/Models/ResourceSku.cs @@ -0,0 +1,76 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.PowerBIDedicated.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Represents the SKU name and Azure pricing tier for PowerBI Dedicated + /// resource. + /// + public partial class ResourceSku + { + /// + /// Initializes a new instance of the ResourceSku class. + /// + public ResourceSku() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ResourceSku class. + /// + /// Name of the SKU level. + /// The name of the Azure pricing tier to which the + /// SKU applies. Possible values include: 'PBIE_Azure' + public ResourceSku(string name, string tier = default(string)) + { + Name = name; + Tier = tier; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets name of the SKU level. + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; set; } + + /// + /// Gets or sets the name of the Azure pricing tier to which the SKU + /// applies. Possible values include: 'PBIE_Azure' + /// + [JsonProperty(PropertyName = "tier")] + public string Tier { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Name"); + } + } + } +} diff --git a/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/Models/SkuDetailsForExistingResource.cs b/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/Models/SkuDetailsForExistingResource.cs new file mode 100644 index 000000000000..4880d366e38e --- /dev/null +++ b/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/Models/SkuDetailsForExistingResource.cs @@ -0,0 +1,67 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.PowerBIDedicated.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// An object that represents SKU details for existing resources + /// + public partial class SkuDetailsForExistingResource + { + /// + /// Initializes a new instance of the SkuDetailsForExistingResource + /// class. + /// + public SkuDetailsForExistingResource() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SkuDetailsForExistingResource + /// class. + /// + /// The SKU in SKU details for existing + /// resources. + public SkuDetailsForExistingResource(ResourceSku sku = default(ResourceSku)) + { + Sku = sku; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the SKU in SKU details for existing resources. + /// + [JsonProperty(PropertyName = "sku")] + public ResourceSku Sku { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Sku != null) + { + Sku.Validate(); + } + } + } +} diff --git a/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/Models/SkuEnumerationForExistingResourceResult.cs b/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/Models/SkuEnumerationForExistingResourceResult.cs new file mode 100644 index 000000000000..5572990a3727 --- /dev/null +++ b/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/Models/SkuEnumerationForExistingResourceResult.cs @@ -0,0 +1,57 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.PowerBIDedicated.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// An object that represents enumerating SKUs for existing resources + /// + public partial class SkuEnumerationForExistingResourceResult + { + /// + /// Initializes a new instance of the + /// SkuEnumerationForExistingResourceResult class. + /// + public SkuEnumerationForExistingResourceResult() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// SkuEnumerationForExistingResourceResult class. + /// + /// The collection of available SKUs for existing + /// resources + public SkuEnumerationForExistingResourceResult(IList value = default(IList)) + { + Value = value; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the collection of available SKUs for existing + /// resources + /// + [JsonProperty(PropertyName = "value")] + public IList Value { get; set; } + + } +} diff --git a/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/Models/SkuEnumerationForNewResourceResult.cs b/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/Models/SkuEnumerationForNewResourceResult.cs new file mode 100644 index 000000000000..540b0ee7e973 --- /dev/null +++ b/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/Models/SkuEnumerationForNewResourceResult.cs @@ -0,0 +1,56 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.PowerBIDedicated.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// An object that represents enumerating SKUs for new resources + /// + public partial class SkuEnumerationForNewResourceResult + { + /// + /// Initializes a new instance of the + /// SkuEnumerationForNewResourceResult class. + /// + public SkuEnumerationForNewResourceResult() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// SkuEnumerationForNewResourceResult class. + /// + /// The collection of available SKUs for new + /// resources + public SkuEnumerationForNewResourceResult(IList value = default(IList)) + { + Value = value; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the collection of available SKUs for new resources + /// + [JsonProperty(PropertyName = "value")] + public IList Value { get; set; } + + } +} diff --git a/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/Models/SkuTier.cs b/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/Models/SkuTier.cs new file mode 100644 index 000000000000..f7af61d620d1 --- /dev/null +++ b/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/Models/SkuTier.cs @@ -0,0 +1,21 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.PowerBIDedicated.Models +{ + + /// + /// Defines values for SkuTier. + /// + public static class SkuTier + { + public const string PBIEAzure = "PBIE_Azure"; + } +} diff --git a/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/Models/State.cs b/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/Models/State.cs new file mode 100644 index 000000000000..962a375c909f --- /dev/null +++ b/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/Models/State.cs @@ -0,0 +1,32 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.PowerBIDedicated.Models +{ + + /// + /// Defines values for State. + /// + public static class State + { + public const string Deleting = "Deleting"; + public const string Succeeded = "Succeeded"; + public const string Failed = "Failed"; + public const string Paused = "Paused"; + public const string Suspended = "Suspended"; + public const string Provisioning = "Provisioning"; + public const string Updating = "Updating"; + public const string Suspending = "Suspending"; + public const string Pausing = "Pausing"; + public const string Resuming = "Resuming"; + public const string Preparing = "Preparing"; + public const string Scaling = "Scaling"; + } +} diff --git a/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/Operations.cs b/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/Operations.cs new file mode 100644 index 000000000000..55c8c2176602 --- /dev/null +++ b/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/Operations.cs @@ -0,0 +1,390 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.PowerBIDedicated +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Operations operations. + /// + internal partial class Operations : IServiceOperations, IOperations + { + /// + /// Initializes a new instance of the Operations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal Operations(PowerBIDedicatedManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the PowerBIDedicatedManagementClient + /// + public PowerBIDedicatedManagementClient Client { get; private set; } + + /// + /// Lists all of the available PowerBIDedicated REST API operations. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.PowerBIDedicated/operations").ToString(); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Lists all of the available PowerBIDedicated REST API operations. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (nextPageLink == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/OperationsExtensions.cs b/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/OperationsExtensions.cs new file mode 100644 index 000000000000..ffbe0b160963 --- /dev/null +++ b/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/OperationsExtensions.cs @@ -0,0 +1,87 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.PowerBIDedicated +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for Operations. + /// + public static partial class OperationsExtensions + { + /// + /// Lists all of the available PowerBIDedicated REST API operations. + /// + /// + /// The operations group for this extension method. + /// + public static IPage List(this IOperations operations) + { + return operations.ListAsync().GetAwaiter().GetResult(); + } + + /// + /// Lists all of the available PowerBIDedicated REST API operations. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async Task> ListAsync(this IOperations operations, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Lists all of the available PowerBIDedicated REST API operations. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListNext(this IOperations operations, string nextPageLink) + { + return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Lists all of the available PowerBIDedicated REST API operations. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListNextAsync(this IOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/PowerBIDedicatedManagementClient.cs b/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/PowerBIDedicatedManagementClient.cs new file mode 100644 index 000000000000..17b1a7f0c261 --- /dev/null +++ b/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/PowerBIDedicatedManagementClient.cs @@ -0,0 +1,369 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.PowerBIDedicated +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Microsoft.Rest.Serialization; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + + /// + /// PowerBI Dedicated Web API provides a RESTful set of web services that + /// enables users to create, retrieve, update, and delete Power BI + /// dedicated capacities + /// + public partial class PowerBIDedicatedManagementClient : ServiceClient, IPowerBIDedicatedManagementClient, IAzureClient + { + /// + /// The base URI of the service. + /// + public System.Uri BaseUri { get; set; } + + /// + /// Gets or sets json serialization settings. + /// + public JsonSerializerSettings SerializationSettings { get; private set; } + + /// + /// Gets or sets json deserialization settings. + /// + public JsonSerializerSettings DeserializationSettings { get; private set; } + + /// + /// Credentials needed for the client to connect to Azure. + /// + public ServiceClientCredentials Credentials { get; private set; } + + /// + /// A unique identifier for a Microsoft Azure subscription. The subscription ID + /// forms part of the URI for every service call. + /// + public string SubscriptionId { get; set; } + + /// + /// The client API version. + /// + public string ApiVersion { get; private set; } + + /// + /// The preferred language for the response. + /// + public string AcceptLanguage { get; set; } + + /// + /// The retry timeout in seconds for Long Running Operations. Default value is + /// 30. + /// + public int? LongRunningOperationRetryTimeout { get; set; } + + /// + /// Whether a unique x-ms-client-request-id should be generated. When set to + /// true a unique x-ms-client-request-id value is generated and included in + /// each request. Default is true. + /// + public bool? GenerateClientRequestId { get; set; } + + /// + /// Gets the ICapacitiesOperations. + /// + public virtual ICapacitiesOperations Capacities { get; private set; } + + /// + /// Gets the IOperations. + /// + public virtual IOperations Operations { get; private set; } + + /// + /// Initializes a new instance of the PowerBIDedicatedManagementClient class. + /// + /// + /// HttpClient to be used + /// + /// + /// True: will dispose the provided httpClient on calling PowerBIDedicatedManagementClient.Dispose(). False: will not dispose provided httpClient + protected PowerBIDedicatedManagementClient(HttpClient httpClient, bool disposeHttpClient) : base(httpClient, disposeHttpClient) + { + Initialize(); + } + + /// + /// Initializes a new instance of the PowerBIDedicatedManagementClient class. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + protected PowerBIDedicatedManagementClient(params DelegatingHandler[] handlers) : base(handlers) + { + Initialize(); + } + + /// + /// Initializes a new instance of the PowerBIDedicatedManagementClient class. + /// + /// + /// Optional. The http client handler used to handle http transport. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + protected PowerBIDedicatedManagementClient(HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : base(rootHandler, handlers) + { + Initialize(); + } + + /// + /// Initializes a new instance of the PowerBIDedicatedManagementClient class. + /// + /// + /// Optional. The base URI of the service. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + /// + /// Thrown when a required parameter is null + /// + protected PowerBIDedicatedManagementClient(System.Uri baseUri, params DelegatingHandler[] handlers) : this(handlers) + { + if (baseUri == null) + { + throw new System.ArgumentNullException("baseUri"); + } + BaseUri = baseUri; + } + + /// + /// Initializes a new instance of the PowerBIDedicatedManagementClient class. + /// + /// + /// Optional. The base URI of the service. + /// + /// + /// Optional. The http client handler used to handle http transport. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + /// + /// Thrown when a required parameter is null + /// + protected PowerBIDedicatedManagementClient(System.Uri baseUri, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers) + { + if (baseUri == null) + { + throw new System.ArgumentNullException("baseUri"); + } + BaseUri = baseUri; + } + + /// + /// Initializes a new instance of the PowerBIDedicatedManagementClient class. + /// + /// + /// Required. Credentials needed for the client to connect to Azure. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + /// + /// Thrown when a required parameter is null + /// + public PowerBIDedicatedManagementClient(ServiceClientCredentials credentials, params DelegatingHandler[] handlers) : this(handlers) + { + if (credentials == null) + { + throw new System.ArgumentNullException("credentials"); + } + Credentials = credentials; + if (Credentials != null) + { + Credentials.InitializeServiceClient(this); + } + } + + /// + /// Initializes a new instance of the PowerBIDedicatedManagementClient class. + /// + /// + /// Required. Credentials needed for the client to connect to Azure. + /// + /// + /// HttpClient to be used + /// + /// + /// True: will dispose the provided httpClient on calling PowerBIDedicatedManagementClient.Dispose(). False: will not dispose provided httpClient + /// + /// Thrown when a required parameter is null + /// + public PowerBIDedicatedManagementClient(ServiceClientCredentials credentials, HttpClient httpClient, bool disposeHttpClient) : this(httpClient, disposeHttpClient) + { + if (credentials == null) + { + throw new System.ArgumentNullException("credentials"); + } + Credentials = credentials; + if (Credentials != null) + { + Credentials.InitializeServiceClient(this); + } + } + + /// + /// Initializes a new instance of the PowerBIDedicatedManagementClient class. + /// + /// + /// Required. Credentials needed for the client to connect to Azure. + /// + /// + /// Optional. The http client handler used to handle http transport. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + /// + /// Thrown when a required parameter is null + /// + public PowerBIDedicatedManagementClient(ServiceClientCredentials credentials, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers) + { + if (credentials == null) + { + throw new System.ArgumentNullException("credentials"); + } + Credentials = credentials; + if (Credentials != null) + { + Credentials.InitializeServiceClient(this); + } + } + + /// + /// Initializes a new instance of the PowerBIDedicatedManagementClient class. + /// + /// + /// Optional. The base URI of the service. + /// + /// + /// Required. Credentials needed for the client to connect to Azure. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + /// + /// Thrown when a required parameter is null + /// + public PowerBIDedicatedManagementClient(System.Uri baseUri, ServiceClientCredentials credentials, params DelegatingHandler[] handlers) : this(handlers) + { + if (baseUri == null) + { + throw new System.ArgumentNullException("baseUri"); + } + if (credentials == null) + { + throw new System.ArgumentNullException("credentials"); + } + BaseUri = baseUri; + Credentials = credentials; + if (Credentials != null) + { + Credentials.InitializeServiceClient(this); + } + } + + /// + /// Initializes a new instance of the PowerBIDedicatedManagementClient class. + /// + /// + /// Optional. The base URI of the service. + /// + /// + /// Required. Credentials needed for the client to connect to Azure. + /// + /// + /// Optional. The http client handler used to handle http transport. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + /// + /// Thrown when a required parameter is null + /// + public PowerBIDedicatedManagementClient(System.Uri baseUri, ServiceClientCredentials credentials, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers) + { + if (baseUri == null) + { + throw new System.ArgumentNullException("baseUri"); + } + if (credentials == null) + { + throw new System.ArgumentNullException("credentials"); + } + BaseUri = baseUri; + Credentials = credentials; + if (Credentials != null) + { + Credentials.InitializeServiceClient(this); + } + } + + /// + /// An optional partial-method to perform custom initialization. + /// + partial void CustomInitialize(); + /// + /// Initializes client properties. + /// + private void Initialize() + { + Capacities = new CapacitiesOperations(this); + Operations = new Operations(this); + BaseUri = new System.Uri("https://management.azure.com"); + ApiVersion = "2017-10-01"; + AcceptLanguage = "en-US"; + LongRunningOperationRetryTimeout = 30; + GenerateClientRequestId = true; + SerializationSettings = new JsonSerializerSettings + { + Formatting = Newtonsoft.Json.Formatting.Indented, + DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat, + DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc, + NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore, + ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize, + ContractResolver = new ReadOnlyJsonContractResolver(), + Converters = new List + { + new Iso8601TimeSpanConverter() + } + }; + SerializationSettings.Converters.Add(new TransformationJsonConverter()); + DeserializationSettings = new JsonSerializerSettings + { + DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat, + DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc, + NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore, + ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize, + ContractResolver = new ReadOnlyJsonContractResolver(), + Converters = new List + { + new Iso8601TimeSpanConverter() + } + }; + CustomInitialize(); + DeserializationSettings.Converters.Add(new TransformationJsonConverter()); + DeserializationSettings.Converters.Add(new CloudErrorJsonConverter()); + } + } +} diff --git a/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/SdkInfo_PowerBIDedicated.cs b/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/SdkInfo_PowerBIDedicated.cs new file mode 100644 index 000000000000..29cefc19f816 --- /dev/null +++ b/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/SdkInfo_PowerBIDedicated.cs @@ -0,0 +1,28 @@ + +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.PowerBIDedicated +{ + using System; + using System.Collections.Generic; + using System.Linq; + + internal static partial class SdkInfo + { + public static IEnumerable> ApiInfo_PowerBIDedicated + { + get + { + return new Tuple[] + { + new Tuple("PowerBIDedicated", "Capacities", "2017-10-01"), + new Tuple("PowerBIDedicated", "Operations", "2017-10-01"), + }.AsEnumerable(); + } + } + } +} diff --git a/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/PowerBIDedicated.Management.Sdk.csproj b/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/PowerBIDedicated.Management.Sdk.csproj new file mode 100644 index 000000000000..35cc77b468b4 --- /dev/null +++ b/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/PowerBIDedicated.Management.Sdk.csproj @@ -0,0 +1,13 @@ + + + PowerBIEmbedded + + + + netstandard2.0 + Microsoft.Azure.PowerShell.PowerBIDedicated.Management.Sdk + Microsoft.Azure.Management.PowerBIDedicated + $(NoWarn);CS0108;CS1573 + + + \ No newline at end of file diff --git a/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Properties/AssemblyInfo.cs b/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Properties/AssemblyInfo.cs new file mode 100644 index 000000000000..d0e85ec29ad8 --- /dev/null +++ b/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Properties/AssemblyInfo.cs @@ -0,0 +1,29 @@ +// ---------------------------------------------------------------------------------- +// +// Copyright Microsoft Corporation +// 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. +// ---------------------------------------------------------------------------------- + +using System; +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +[assembly: AssemblyTitle("Microsoft Azure Powershell - PowerBI Dedicated Management SDK")] +[assembly: AssemblyCompany(Microsoft.WindowsAzure.Commands.Common.AzurePowerShell.AssemblyCompany)] +[assembly: AssemblyProduct(Microsoft.WindowsAzure.Commands.Common.AzurePowerShell.AssemblyProduct)] +[assembly: AssemblyCopyright(Microsoft.WindowsAzure.Commands.Common.AzurePowerShell.AssemblyCopyright)] + +[assembly: ComVisible(false)] +[assembly: CLSCompliant(false)] + +[assembly: AssemblyVersion("0.11.0.0")] +[assembly: AssemblyFileVersion("0.11.0.0")] \ No newline at end of file diff --git a/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/README.md b/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/README.md new file mode 100644 index 000000000000..ab2b0a948e32 --- /dev/null +++ b/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/README.md @@ -0,0 +1,34 @@ +# Overall +This directory contains management plane service clients of Az.Storage module. + +## Run Generation +In this directory, run AutoRest: +``` +autorest --reset +autorest --use:@microsoft.azure/autorest.csharp@2.3.90 +autorest.cmd README.md --version=v2 +``` + +### AutoRest Configuration +> see https://aka.ms/autorest +``` yaml +csharp: true +clear-output-folder: true +reflect-api-versions: true +openapi-type: arm +azure-arm: true +license-header: MICROSOFT_MIT_NO_VERSION +``` + + + +### +``` yaml +commit: d2bb2feadd0deb1c7212706aa65cab2f56adccc7 +input-file: + - https://github.com/Azure/azure-rest-api-specs/blob/$(commit)/specification/powerbidedicated/resource-manager/Microsoft.PowerBIdedicated/stable/2017-10-01/powerbidedicated.json + +output-folder: Generated + +namespace: Microsoft.Azure.Management.PowerBIDedicated +``` \ No newline at end of file diff --git a/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/IPowerBIEmbeddedManagementClient.cs b/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/IPowerBIEmbeddedManagementClient.cs new file mode 100644 index 000000000000..88d97ae56e31 --- /dev/null +++ b/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/IPowerBIEmbeddedManagementClient.cs @@ -0,0 +1,102 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.PowerBIEmbedded +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Client to manage your Power BI Embedded workspace collections and + /// retrieve workspaces. + /// + public partial interface IPowerBIEmbeddedManagementClient : System.IDisposable + { + /// + /// The base URI of the service. + /// + System.Uri BaseUri { get; set; } + + /// + /// Gets or sets json serialization settings. + /// + JsonSerializerSettings SerializationSettings { get; } + + /// + /// Gets or sets json deserialization settings. + /// + JsonSerializerSettings DeserializationSettings { get; } + + /// + /// Credentials needed for the client to connect to Azure. + /// + ServiceClientCredentials Credentials { get; } + + /// + /// Gets subscription credentials which uniquely identify a Microsoft + /// Azure subscription. The subscription ID forms part of the URI for + /// every service call. + /// + string SubscriptionId { get; set; } + + /// + /// Client Api Version. + /// + string ApiVersion { get; } + + /// + /// The preferred language for the response. + /// + string AcceptLanguage { get; set; } + + /// + /// The retry timeout in seconds for Long Running Operations. Default + /// value is 30. + /// + int? LongRunningOperationRetryTimeout { get; set; } + + /// + /// Whether a unique x-ms-client-request-id should be generated. When + /// set to true a unique x-ms-client-request-id value is generated and + /// included in each request. Default is true. + /// + bool? GenerateClientRequestId { get; set; } + + + /// + /// Gets the IWorkspaceCollectionsOperations. + /// + IWorkspaceCollectionsOperations WorkspaceCollections { get; } + + /// + /// Gets the IWorkspacesOperations. + /// + IWorkspacesOperations Workspaces { get; } + + /// + /// Indicates which operations can be performed by the Power BI + /// Resource Provider. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + Task> GetAvailableOperationsWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + + } +} diff --git a/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/IWorkspaceCollectionsOperations.cs b/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/IWorkspaceCollectionsOperations.cs new file mode 100644 index 000000000000..147603d35988 --- /dev/null +++ b/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/IWorkspaceCollectionsOperations.cs @@ -0,0 +1,303 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.PowerBIEmbedded +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// WorkspaceCollectionsOperations operations. + /// + public partial interface IWorkspaceCollectionsOperations + { + /// + /// Retrieves an existing Power BI Workspace Collection. + /// + /// + /// Azure resource group + /// + /// + /// Power BI Embedded Workspace Collection name + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetByNameWithHttpMessagesAsync(string resourceGroupName, string workspaceCollectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Creates a new Power BI Workspace Collection with the specified + /// properties. A Power BI Workspace Collection contains one or more + /// workspaces, and can be used to provision keys that provide API + /// access to those workspaces. + /// + /// + /// Azure resource group + /// + /// + /// Power BI Embedded Workspace Collection name + /// + /// + /// Create workspace collection request + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> CreateWithHttpMessagesAsync(string resourceGroupName, string workspaceCollectionName, CreateWorkspaceCollectionRequest body, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Update an existing Power BI Workspace Collection with the specified + /// properties. + /// + /// + /// Azure resource group + /// + /// + /// Power BI Embedded Workspace Collection name + /// + /// + /// Update workspace collection request + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceCollectionName, UpdateWorkspaceCollectionRequest body, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Delete a Power BI Workspace Collection. + /// + /// + /// Azure resource group + /// + /// + /// Power BI Embedded Workspace Collection name + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task DeleteWithHttpMessagesAsync(string resourceGroupName, string workspaceCollectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Verify the specified Power BI Workspace Collection name is valid + /// and not already in use. + /// + /// + /// Azure location + /// + /// + /// Check name availability request + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> CheckNameAvailabilityWithHttpMessagesAsync(string location, CheckNameRequest body, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Retrieves all existing Power BI workspace collections in the + /// specified resource group. + /// + /// + /// Azure resource group + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Retrieves all existing Power BI workspace collections in the + /// specified subscription. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListBySubscriptionWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Retrieves the primary and secondary access keys for the specified + /// Power BI Workspace Collection. + /// + /// + /// Azure resource group + /// + /// + /// Power BI Embedded Workspace Collection name + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetAccessKeysWithHttpMessagesAsync(string resourceGroupName, string workspaceCollectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Regenerates the primary or secondary access key for the specified + /// Power BI Workspace Collection. + /// + /// + /// Azure resource group + /// + /// + /// Power BI Embedded Workspace Collection name + /// + /// + /// Access key to regenerate + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> RegenerateKeyWithHttpMessagesAsync(string resourceGroupName, string workspaceCollectionName, WorkspaceCollectionAccessKey body, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Migrates an existing Power BI Workspace Collection to a different + /// resource group and/or subscription. + /// + /// + /// Azure resource group + /// + /// + /// Workspace migration request + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task MigrateWithHttpMessagesAsync(string resourceGroupName, MigrateWorkspaceCollectionRequest body, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Delete a Power BI Workspace Collection. + /// + /// + /// Azure resource group + /// + /// + /// Power BI Embedded Workspace Collection name + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string workspaceCollectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/IWorkspacesOperations.cs b/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/IWorkspacesOperations.cs new file mode 100644 index 000000000000..6897d92f3f26 --- /dev/null +++ b/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/IWorkspacesOperations.cs @@ -0,0 +1,53 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.PowerBIEmbedded +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// WorkspacesOperations operations. + /// + public partial interface IWorkspacesOperations + { + /// + /// Retrieves all existing Power BI workspaces in the specified + /// workspace collection. + /// + /// + /// Azure resource group + /// + /// + /// Power BI Embedded Workspace Collection name + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListWithHttpMessagesAsync(string resourceGroupName, string workspaceCollectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/Models/AccessKeyName.cs b/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/Models/AccessKeyName.cs new file mode 100644 index 000000000000..e868aa371340 --- /dev/null +++ b/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/Models/AccessKeyName.cs @@ -0,0 +1,60 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.PowerBIEmbedded.Models +{ + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; + + /// + /// Defines values for AccessKeyName. + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum AccessKeyName + { + [EnumMember(Value = "key1")] + Key1, + [EnumMember(Value = "key2")] + Key2 + } + internal static class AccessKeyNameEnumExtension + { + internal static string ToSerializedValue(this AccessKeyName? value) + { + return value == null ? null : ((AccessKeyName)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this AccessKeyName value) + { + switch( value ) + { + case AccessKeyName.Key1: + return "key1"; + case AccessKeyName.Key2: + return "key2"; + } + return null; + } + + internal static AccessKeyName? ParseAccessKeyName(this string value) + { + switch( value ) + { + case "key1": + return AccessKeyName.Key1; + case "key2": + return AccessKeyName.Key2; + } + return null; + } + } +} diff --git a/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/Models/AzureSku.cs b/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/Models/AzureSku.cs new file mode 100644 index 000000000000..59e9be22186d --- /dev/null +++ b/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/Models/AzureSku.cs @@ -0,0 +1,53 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.PowerBIEmbedded.Models +{ + using Newtonsoft.Json; + using System.Linq; + + public partial class AzureSku + { + /// + /// Initializes a new instance of the AzureSku class. + /// + public AzureSku() + { + CustomInit(); + } + + /// + /// Static constructor for AzureSku class. + /// + static AzureSku() + { + Name = "S1"; + Tier = "Standard"; + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// SKU name + /// + [JsonProperty(PropertyName = "name")] + public static string Name { get; private set; } + + /// + /// SKU tier + /// + [JsonProperty(PropertyName = "tier")] + public static string Tier { get; private set; } + + } +} diff --git a/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/Models/CheckNameReason.cs b/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/Models/CheckNameReason.cs new file mode 100644 index 000000000000..de90e8ad35cc --- /dev/null +++ b/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/Models/CheckNameReason.cs @@ -0,0 +1,22 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.PowerBIEmbedded.Models +{ + + /// + /// Defines values for CheckNameReason. + /// + public static class CheckNameReason + { + public const string Unavailable = "Unavailable"; + public const string Invalid = "Invalid"; + } +} diff --git a/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/Models/CheckNameRequest.cs b/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/Models/CheckNameRequest.cs new file mode 100644 index 000000000000..3ad0ca2caf2b --- /dev/null +++ b/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/Models/CheckNameRequest.cs @@ -0,0 +1,56 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.PowerBIEmbedded.Models +{ + using Newtonsoft.Json; + using System.Linq; + + public partial class CheckNameRequest + { + /// + /// Initializes a new instance of the CheckNameRequest class. + /// + public CheckNameRequest() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the CheckNameRequest class. + /// + /// Workspace collection name + /// Resource type + public CheckNameRequest(string name = default(string), string type = default(string)) + { + Name = name; + Type = type; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets workspace collection name + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; set; } + + /// + /// Gets or sets resource type + /// + [JsonProperty(PropertyName = "type")] + public string Type { get; set; } + + } +} diff --git a/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/Models/CheckNameResponse.cs b/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/Models/CheckNameResponse.cs new file mode 100644 index 000000000000..f8462196e1e7 --- /dev/null +++ b/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/Models/CheckNameResponse.cs @@ -0,0 +1,73 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.PowerBIEmbedded.Models +{ + using Newtonsoft.Json; + using System.Linq; + + public partial class CheckNameResponse + { + /// + /// Initializes a new instance of the CheckNameResponse class. + /// + public CheckNameResponse() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the CheckNameResponse class. + /// + /// Specifies a Boolean value that + /// indicates whether the specified Power BI Workspace Collection name + /// is available to use. + /// Reason why the workspace collection name + /// cannot be used. Possible values include: 'Unavailable', + /// 'Invalid' + /// Message indicating an unavailable name due to + /// a conflict, or a description of the naming rules that are + /// violated. + public CheckNameResponse(bool? nameAvailable = default(bool?), string reason = default(string), string message = default(string)) + { + NameAvailable = nameAvailable; + Reason = reason; + Message = message; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets specifies a Boolean value that indicates whether the + /// specified Power BI Workspace Collection name is available to use. + /// + [JsonProperty(PropertyName = "nameAvailable")] + public bool? NameAvailable { get; set; } + + /// + /// Gets or sets reason why the workspace collection name cannot be + /// used. Possible values include: 'Unavailable', 'Invalid' + /// + [JsonProperty(PropertyName = "reason")] + public string Reason { get; set; } + + /// + /// Gets or sets message indicating an unavailable name due to a + /// conflict, or a description of the naming rules that are violated. + /// + [JsonProperty(PropertyName = "message")] + public string Message { get; set; } + + } +} diff --git a/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/Models/CreateWorkspaceCollectionRequest.cs b/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/Models/CreateWorkspaceCollectionRequest.cs new file mode 100644 index 000000000000..e18f2a08445c --- /dev/null +++ b/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/Models/CreateWorkspaceCollectionRequest.cs @@ -0,0 +1,70 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.PowerBIEmbedded.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + public partial class CreateWorkspaceCollectionRequest + { + /// + /// Initializes a new instance of the CreateWorkspaceCollectionRequest + /// class. + /// + public CreateWorkspaceCollectionRequest() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the CreateWorkspaceCollectionRequest + /// class. + /// + /// Azure location + public CreateWorkspaceCollectionRequest(string location = default(string), IDictionary tags = default(IDictionary)) + { + Location = location; + Tags = tags; + CustomInit(); + } + /// + /// Static constructor for CreateWorkspaceCollectionRequest class. + /// + static CreateWorkspaceCollectionRequest() + { + Sku = new AzureSku(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets azure location + /// + [JsonProperty(PropertyName = "location")] + public string Location { get; set; } + + /// + /// + [JsonProperty(PropertyName = "tags")] + public IDictionary Tags { get; set; } + + /// + /// + [JsonProperty(PropertyName = "sku")] + public static AzureSku Sku { get; private set; } + + } +} diff --git a/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/Models/Display.cs b/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/Models/Display.cs new file mode 100644 index 000000000000..84d8ed6509eb --- /dev/null +++ b/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/Models/Display.cs @@ -0,0 +1,107 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.PowerBIEmbedded.Models +{ + using Newtonsoft.Json; + using System.Linq; + + public partial class Display + { + /// + /// Initializes a new instance of the Display class. + /// + public Display() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the Display class. + /// + /// The localized friendly form of the resource + /// provider name. This form is also expected to include the + /// publisher/company responsible. Use Title Casing. Begin with + /// “Microsoft” for 1st party services. + /// The localized friendly form of the resource + /// type related to this action/operation. This form should match the + /// public documentation for the resource provider. Use Title Casing. + /// For examples, refer to the “name” section. + /// The localized friendly name for the + /// operation as shown to the user. This name should be concise (to fit + /// in drop downs), but clear (self-documenting). Use Title Casing and + /// include the entity/resource to which it applies. + /// The localized friendly description for + /// the operation as shown to the user. This description should be + /// thorough, yet concise. It will be used in tool-tips and detailed + /// views. + /// The intended executor of the operation; + /// governs the display of the operation in the RBAC UX and the audit + /// logs UX. Default value is 'user,system' + public Display(string provider = default(string), string resource = default(string), string operation = default(string), string description = default(string), string origin = default(string)) + { + Provider = provider; + Resource = resource; + Operation = operation; + Description = description; + Origin = origin; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the localized friendly form of the resource provider + /// name. This form is also expected to include the publisher/company + /// responsible. Use Title Casing. Begin with “Microsoft” for 1st party + /// services. + /// + [JsonProperty(PropertyName = "provider")] + public string Provider { get; set; } + + /// + /// Gets or sets the localized friendly form of the resource type + /// related to this action/operation. This form should match the public + /// documentation for the resource provider. Use Title Casing. For + /// examples, refer to the “name” section. + /// + [JsonProperty(PropertyName = "resource")] + public string Resource { get; set; } + + /// + /// Gets or sets the localized friendly name for the operation as shown + /// to the user. This name should be concise (to fit in drop downs), + /// but clear (self-documenting). Use Title Casing and include the + /// entity/resource to which it applies. + /// + [JsonProperty(PropertyName = "operation")] + public string Operation { get; set; } + + /// + /// Gets or sets the localized friendly description for the operation + /// as shown to the user. This description should be thorough, yet + /// concise. It will be used in tool-tips and detailed views. + /// + [JsonProperty(PropertyName = "description")] + public string Description { get; set; } + + /// + /// Gets or sets the intended executor of the operation; governs the + /// display of the operation in the RBAC UX and the audit logs UX. + /// Default value is 'user,system' + /// + [JsonProperty(PropertyName = "origin")] + public string Origin { get; set; } + + } +} diff --git a/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/Models/Error.cs b/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/Models/Error.cs new file mode 100644 index 000000000000..a75610e53b8c --- /dev/null +++ b/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/Models/Error.cs @@ -0,0 +1,66 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.PowerBIEmbedded.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + public partial class Error + { + /// + /// Initializes a new instance of the Error class. + /// + public Error() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the Error class. + /// + public Error(string code = default(string), string message = default(string), string target = default(string), IList details = default(IList)) + { + Code = code; + Message = message; + Target = target; + Details = details; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "code")] + public string Code { get; set; } + + /// + /// + [JsonProperty(PropertyName = "message")] + public string Message { get; set; } + + /// + /// + [JsonProperty(PropertyName = "target")] + public string Target { get; set; } + + /// + /// + [JsonProperty(PropertyName = "details")] + public IList Details { get; set; } + + } +} diff --git a/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/Models/ErrorDetail.cs b/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/Models/ErrorDetail.cs new file mode 100644 index 000000000000..900da4785aad --- /dev/null +++ b/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/Models/ErrorDetail.cs @@ -0,0 +1,58 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.PowerBIEmbedded.Models +{ + using Newtonsoft.Json; + using System.Linq; + + public partial class ErrorDetail + { + /// + /// Initializes a new instance of the ErrorDetail class. + /// + public ErrorDetail() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ErrorDetail class. + /// + public ErrorDetail(string code = default(string), string message = default(string), string target = default(string)) + { + Code = code; + Message = message; + Target = target; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "code")] + public string Code { get; set; } + + /// + /// + [JsonProperty(PropertyName = "message")] + public string Message { get; set; } + + /// + /// + [JsonProperty(PropertyName = "target")] + public string Target { get; set; } + + } +} diff --git a/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/Models/ErrorException.cs b/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/Models/ErrorException.cs new file mode 100644 index 000000000000..ecee4d11f2d2 --- /dev/null +++ b/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/Models/ErrorException.cs @@ -0,0 +1,61 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.PowerBIEmbedded.Models +{ + using Microsoft.Rest; + + /// + /// Exception thrown for an invalid response with Error information. + /// + public partial class ErrorException : RestException + { + /// + /// Gets information about the associated HTTP request. + /// + public HttpRequestMessageWrapper Request { get; set; } + + /// + /// Gets information about the associated HTTP response. + /// + public HttpResponseMessageWrapper Response { get; set; } + + /// + /// Gets or sets the body object. + /// + public Error Body { get; set; } + + /// + /// Initializes a new instance of the ErrorException class. + /// + public ErrorException() + { + } + + /// + /// Initializes a new instance of the ErrorException class. + /// + /// The exception message. + public ErrorException(string message) + : this(message, null) + { + } + + /// + /// Initializes a new instance of the ErrorException class. + /// + /// The exception message. + /// Inner exception. + public ErrorException(string message, System.Exception innerException) + : base(message, innerException) + { + } + } +} diff --git a/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/Models/MigrateWorkspaceCollectionRequest.cs b/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/Models/MigrateWorkspaceCollectionRequest.cs new file mode 100644 index 000000000000..5e7bb354d420 --- /dev/null +++ b/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/Models/MigrateWorkspaceCollectionRequest.cs @@ -0,0 +1,60 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.PowerBIEmbedded.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + public partial class MigrateWorkspaceCollectionRequest + { + /// + /// Initializes a new instance of the MigrateWorkspaceCollectionRequest + /// class. + /// + public MigrateWorkspaceCollectionRequest() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the MigrateWorkspaceCollectionRequest + /// class. + /// + /// Name of the resource group the + /// Power BI workspace collections will be migrated to. + public MigrateWorkspaceCollectionRequest(string targetResourceGroup = default(string), IList resources = default(IList)) + { + TargetResourceGroup = targetResourceGroup; + Resources = resources; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets name of the resource group the Power BI workspace + /// collections will be migrated to. + /// + [JsonProperty(PropertyName = "targetResourceGroup")] + public string TargetResourceGroup { get; set; } + + /// + /// + [JsonProperty(PropertyName = "resources")] + public IList Resources { get; set; } + + } +} diff --git a/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/Models/Operation.cs b/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/Models/Operation.cs new file mode 100644 index 000000000000..f756d5ca6864 --- /dev/null +++ b/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/Models/Operation.cs @@ -0,0 +1,58 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.PowerBIEmbedded.Models +{ + using Newtonsoft.Json; + using System.Linq; + + public partial class Operation + { + /// + /// Initializes a new instance of the Operation class. + /// + public Operation() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the Operation class. + /// + /// The name of the operation being performed on + /// this particular object. This name should match the action name that + /// appears in RBAC / the event service. + public Operation(string name = default(string), Display display = default(Display)) + { + Name = name; + Display = display; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the name of the operation being performed on this + /// particular object. This name should match the action name that + /// appears in RBAC / the event service. + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; set; } + + /// + /// + [JsonProperty(PropertyName = "display")] + public Display Display { get; set; } + + } +} diff --git a/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/Models/OperationList.cs b/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/Models/OperationList.cs new file mode 100644 index 000000000000..55a7e24189c3 --- /dev/null +++ b/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/Models/OperationList.cs @@ -0,0 +1,48 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.PowerBIEmbedded.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + public partial class OperationList + { + /// + /// Initializes a new instance of the OperationList class. + /// + public OperationList() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the OperationList class. + /// + public OperationList(IList value = default(IList)) + { + Value = value; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "value")] + public IList Value { get; set; } + + } +} diff --git a/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/Models/Page.cs b/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/Models/Page.cs new file mode 100644 index 000000000000..5e98d8e07b79 --- /dev/null +++ b/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/Models/Page.cs @@ -0,0 +1,53 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.PowerBIEmbedded.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + + /// + /// Defines a page in Azure responses. + /// + /// Type of the page content items + [JsonObject] + public class Page : IPage + { + /// + /// Gets the link to the next page. + /// + [JsonProperty("")] + public string NextPageLink { get; private set; } + + [JsonProperty("value")] + private IList Items{ get; set; } + + /// + /// Returns an enumerator that iterates through the collection. + /// + /// A an enumerator that can be used to iterate through the collection. + public IEnumerator GetEnumerator() + { + return Items == null ? System.Linq.Enumerable.Empty().GetEnumerator() : Items.GetEnumerator(); + } + + /// + /// Returns an enumerator that iterates through the collection. + /// + /// A an enumerator that can be used to iterate through the collection. + IEnumerator IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } + } +} diff --git a/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/Models/UpdateWorkspaceCollectionRequest.cs b/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/Models/UpdateWorkspaceCollectionRequest.cs new file mode 100644 index 000000000000..0b626b3d44af --- /dev/null +++ b/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/Models/UpdateWorkspaceCollectionRequest.cs @@ -0,0 +1,62 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.PowerBIEmbedded.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + public partial class UpdateWorkspaceCollectionRequest + { + /// + /// Initializes a new instance of the UpdateWorkspaceCollectionRequest + /// class. + /// + public UpdateWorkspaceCollectionRequest() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the UpdateWorkspaceCollectionRequest + /// class. + /// + public UpdateWorkspaceCollectionRequest(IDictionary tags = default(IDictionary)) + { + Tags = tags; + CustomInit(); + } + /// + /// Static constructor for UpdateWorkspaceCollectionRequest class. + /// + static UpdateWorkspaceCollectionRequest() + { + Sku = new AzureSku(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "tags")] + public IDictionary Tags { get; set; } + + /// + /// + [JsonProperty(PropertyName = "sku")] + public static AzureSku Sku { get; private set; } + + } +} diff --git a/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/Models/Workspace.cs b/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/Models/Workspace.cs new file mode 100644 index 000000000000..69d892d5c621 --- /dev/null +++ b/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/Models/Workspace.cs @@ -0,0 +1,72 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.PowerBIEmbedded.Models +{ + using Newtonsoft.Json; + using System.Linq; + + public partial class Workspace + { + /// + /// Initializes a new instance of the Workspace class. + /// + public Workspace() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the Workspace class. + /// + /// Workspace id + /// Workspace name + /// Resource type + /// Property bag + public Workspace(string id = default(string), string name = default(string), string type = default(string), object properties = default(object)) + { + Id = id; + Name = name; + Type = type; + Properties = properties; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets workspace id + /// + [JsonProperty(PropertyName = "id")] + public string Id { get; set; } + + /// + /// Gets or sets workspace name + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; set; } + + /// + /// Gets or sets resource type + /// + [JsonProperty(PropertyName = "type")] + public string Type { get; set; } + + /// + /// Gets or sets property bag + /// + [JsonProperty(PropertyName = "properties")] + public object Properties { get; set; } + + } +} diff --git a/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/Models/WorkspaceCollection.cs b/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/Models/WorkspaceCollection.cs new file mode 100644 index 000000000000..36049a5460b5 --- /dev/null +++ b/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/Models/WorkspaceCollection.cs @@ -0,0 +1,100 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.PowerBIEmbedded.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + public partial class WorkspaceCollection + { + /// + /// Initializes a new instance of the WorkspaceCollection class. + /// + public WorkspaceCollection() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the WorkspaceCollection class. + /// + /// Resource id + /// Workspace collection name + /// Resource type + /// Azure location + /// Properties + public WorkspaceCollection(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), object properties = default(object)) + { + Id = id; + Name = name; + Type = type; + Location = location; + Tags = tags; + Properties = properties; + CustomInit(); + } + /// + /// Static constructor for WorkspaceCollection class. + /// + static WorkspaceCollection() + { + Sku = new AzureSku(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets resource id + /// + [JsonProperty(PropertyName = "id")] + public string Id { get; set; } + + /// + /// Gets or sets workspace collection name + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; set; } + + /// + /// Gets or sets resource type + /// + [JsonProperty(PropertyName = "type")] + public string Type { get; set; } + + /// + /// Gets or sets azure location + /// + [JsonProperty(PropertyName = "location")] + public string Location { get; set; } + + /// + /// + [JsonProperty(PropertyName = "tags")] + public IDictionary Tags { get; set; } + + /// + /// Gets or sets properties + /// + [JsonProperty(PropertyName = "properties")] + public object Properties { get; set; } + + /// + /// + [JsonProperty(PropertyName = "sku")] + public static AzureSku Sku { get; private set; } + + } +} diff --git a/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/Models/WorkspaceCollectionAccessKey.cs b/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/Models/WorkspaceCollectionAccessKey.cs new file mode 100644 index 000000000000..36f014987777 --- /dev/null +++ b/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/Models/WorkspaceCollectionAccessKey.cs @@ -0,0 +1,51 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.PowerBIEmbedded.Models +{ + using Newtonsoft.Json; + using System.Linq; + + public partial class WorkspaceCollectionAccessKey + { + /// + /// Initializes a new instance of the WorkspaceCollectionAccessKey + /// class. + /// + public WorkspaceCollectionAccessKey() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the WorkspaceCollectionAccessKey + /// class. + /// + /// Key name. Possible values include: 'key1', + /// 'key2' + public WorkspaceCollectionAccessKey(AccessKeyName? keyName = default(AccessKeyName?)) + { + KeyName = keyName; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets key name. Possible values include: 'key1', 'key2' + /// + [JsonProperty(PropertyName = "keyName")] + public AccessKeyName? KeyName { get; set; } + + } +} diff --git a/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/Models/WorkspaceCollectionAccessKeys.cs b/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/Models/WorkspaceCollectionAccessKeys.cs new file mode 100644 index 000000000000..c09f5c26994e --- /dev/null +++ b/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/Models/WorkspaceCollectionAccessKeys.cs @@ -0,0 +1,58 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.PowerBIEmbedded.Models +{ + using Newtonsoft.Json; + using System.Linq; + + public partial class WorkspaceCollectionAccessKeys + { + /// + /// Initializes a new instance of the WorkspaceCollectionAccessKeys + /// class. + /// + public WorkspaceCollectionAccessKeys() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the WorkspaceCollectionAccessKeys + /// class. + /// + /// Access key 1 + /// Access key 2 + public WorkspaceCollectionAccessKeys(string key1 = default(string), string key2 = default(string)) + { + Key1 = key1; + Key2 = key2; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets access key 1 + /// + [JsonProperty(PropertyName = "key1")] + public string Key1 { get; set; } + + /// + /// Gets or sets access key 2 + /// + [JsonProperty(PropertyName = "key2")] + public string Key2 { get; set; } + + } +} diff --git a/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/PowerBIEmbeddedManagementClient.cs b/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/PowerBIEmbeddedManagementClient.cs new file mode 100644 index 000000000000..daa745dcff0d --- /dev/null +++ b/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/PowerBIEmbeddedManagementClient.cs @@ -0,0 +1,538 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.PowerBIEmbedded +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Microsoft.Rest.Serialization; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Client to manage your Power BI Embedded workspace collections and + /// retrieve workspaces. + /// + public partial class PowerBIEmbeddedManagementClient : ServiceClient, IPowerBIEmbeddedManagementClient, IAzureClient + { + /// + /// The base URI of the service. + /// + public System.Uri BaseUri { get; set; } + + /// + /// Gets or sets json serialization settings. + /// + public JsonSerializerSettings SerializationSettings { get; private set; } + + /// + /// Gets or sets json deserialization settings. + /// + public JsonSerializerSettings DeserializationSettings { get; private set; } + + /// + /// Credentials needed for the client to connect to Azure. + /// + public ServiceClientCredentials Credentials { get; private set; } + + /// + /// Gets subscription credentials which uniquely identify a Microsoft Azure + /// subscription. The subscription ID forms part of the URI for every service + /// call. + /// + public string SubscriptionId { get; set; } + + /// + /// Client Api Version. + /// + public string ApiVersion { get; private set; } + + /// + /// The preferred language for the response. + /// + public string AcceptLanguage { get; set; } + + /// + /// The retry timeout in seconds for Long Running Operations. Default value is + /// 30. + /// + public int? LongRunningOperationRetryTimeout { get; set; } + + /// + /// Whether a unique x-ms-client-request-id should be generated. When set to + /// true a unique x-ms-client-request-id value is generated and included in + /// each request. Default is true. + /// + public bool? GenerateClientRequestId { get; set; } + + /// + /// Gets the IWorkspaceCollectionsOperations. + /// + public virtual IWorkspaceCollectionsOperations WorkspaceCollections { get; private set; } + + /// + /// Gets the IWorkspacesOperations. + /// + public virtual IWorkspacesOperations Workspaces { get; private set; } + + /// + /// Initializes a new instance of the PowerBIEmbeddedManagementClient class. + /// + /// + /// HttpClient to be used + /// + /// + /// True: will dispose the provided httpClient on calling PowerBIEmbeddedManagementClient.Dispose(). False: will not dispose provided httpClient + protected PowerBIEmbeddedManagementClient(HttpClient httpClient, bool disposeHttpClient) : base(httpClient, disposeHttpClient) + { + Initialize(); + } + + /// + /// Initializes a new instance of the PowerBIEmbeddedManagementClient class. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + protected PowerBIEmbeddedManagementClient(params DelegatingHandler[] handlers) : base(handlers) + { + Initialize(); + } + + /// + /// Initializes a new instance of the PowerBIEmbeddedManagementClient class. + /// + /// + /// Optional. The http client handler used to handle http transport. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + protected PowerBIEmbeddedManagementClient(HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : base(rootHandler, handlers) + { + Initialize(); + } + + /// + /// Initializes a new instance of the PowerBIEmbeddedManagementClient class. + /// + /// + /// Optional. The base URI of the service. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + /// + /// Thrown when a required parameter is null + /// + protected PowerBIEmbeddedManagementClient(System.Uri baseUri, params DelegatingHandler[] handlers) : this(handlers) + { + if (baseUri == null) + { + throw new System.ArgumentNullException("baseUri"); + } + BaseUri = baseUri; + } + + /// + /// Initializes a new instance of the PowerBIEmbeddedManagementClient class. + /// + /// + /// Optional. The base URI of the service. + /// + /// + /// Optional. The http client handler used to handle http transport. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + /// + /// Thrown when a required parameter is null + /// + protected PowerBIEmbeddedManagementClient(System.Uri baseUri, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers) + { + if (baseUri == null) + { + throw new System.ArgumentNullException("baseUri"); + } + BaseUri = baseUri; + } + + /// + /// Initializes a new instance of the PowerBIEmbeddedManagementClient class. + /// + /// + /// Required. Credentials needed for the client to connect to Azure. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + /// + /// Thrown when a required parameter is null + /// + public PowerBIEmbeddedManagementClient(ServiceClientCredentials credentials, params DelegatingHandler[] handlers) : this(handlers) + { + if (credentials == null) + { + throw new System.ArgumentNullException("credentials"); + } + Credentials = credentials; + if (Credentials != null) + { + Credentials.InitializeServiceClient(this); + } + } + + /// + /// Initializes a new instance of the PowerBIEmbeddedManagementClient class. + /// + /// + /// Required. Credentials needed for the client to connect to Azure. + /// + /// + /// HttpClient to be used + /// + /// + /// True: will dispose the provided httpClient on calling PowerBIEmbeddedManagementClient.Dispose(). False: will not dispose provided httpClient + /// + /// Thrown when a required parameter is null + /// + public PowerBIEmbeddedManagementClient(ServiceClientCredentials credentials, HttpClient httpClient, bool disposeHttpClient) : this(httpClient, disposeHttpClient) + { + if (credentials == null) + { + throw new System.ArgumentNullException("credentials"); + } + Credentials = credentials; + if (Credentials != null) + { + Credentials.InitializeServiceClient(this); + } + } + + /// + /// Initializes a new instance of the PowerBIEmbeddedManagementClient class. + /// + /// + /// Required. Credentials needed for the client to connect to Azure. + /// + /// + /// Optional. The http client handler used to handle http transport. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + /// + /// Thrown when a required parameter is null + /// + public PowerBIEmbeddedManagementClient(ServiceClientCredentials credentials, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers) + { + if (credentials == null) + { + throw new System.ArgumentNullException("credentials"); + } + Credentials = credentials; + if (Credentials != null) + { + Credentials.InitializeServiceClient(this); + } + } + + /// + /// Initializes a new instance of the PowerBIEmbeddedManagementClient class. + /// + /// + /// Optional. The base URI of the service. + /// + /// + /// Required. Credentials needed for the client to connect to Azure. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + /// + /// Thrown when a required parameter is null + /// + public PowerBIEmbeddedManagementClient(System.Uri baseUri, ServiceClientCredentials credentials, params DelegatingHandler[] handlers) : this(handlers) + { + if (baseUri == null) + { + throw new System.ArgumentNullException("baseUri"); + } + if (credentials == null) + { + throw new System.ArgumentNullException("credentials"); + } + BaseUri = baseUri; + Credentials = credentials; + if (Credentials != null) + { + Credentials.InitializeServiceClient(this); + } + } + + /// + /// Initializes a new instance of the PowerBIEmbeddedManagementClient class. + /// + /// + /// Optional. The base URI of the service. + /// + /// + /// Required. Credentials needed for the client to connect to Azure. + /// + /// + /// Optional. The http client handler used to handle http transport. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + /// + /// Thrown when a required parameter is null + /// + public PowerBIEmbeddedManagementClient(System.Uri baseUri, ServiceClientCredentials credentials, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers) + { + if (baseUri == null) + { + throw new System.ArgumentNullException("baseUri"); + } + if (credentials == null) + { + throw new System.ArgumentNullException("credentials"); + } + BaseUri = baseUri; + Credentials = credentials; + if (Credentials != null) + { + Credentials.InitializeServiceClient(this); + } + } + + /// + /// An optional partial-method to perform custom initialization. + /// + partial void CustomInitialize(); + /// + /// Initializes client properties. + /// + private void Initialize() + { + WorkspaceCollections = new WorkspaceCollectionsOperations(this); + Workspaces = new WorkspacesOperations(this); + BaseUri = new System.Uri("https://management.azure.com"); + ApiVersion = "2016-01-29"; + AcceptLanguage = "en-US"; + LongRunningOperationRetryTimeout = 30; + GenerateClientRequestId = true; + SerializationSettings = new JsonSerializerSettings + { + Formatting = Newtonsoft.Json.Formatting.Indented, + DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat, + DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc, + NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore, + ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize, + ContractResolver = new ReadOnlyJsonContractResolver(), + Converters = new List + { + new Iso8601TimeSpanConverter() + } + }; + DeserializationSettings = new JsonSerializerSettings + { + DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat, + DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc, + NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore, + ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize, + ContractResolver = new ReadOnlyJsonContractResolver(), + Converters = new List + { + new Iso8601TimeSpanConverter() + } + }; + CustomInitialize(); + DeserializationSettings.Converters.Add(new CloudErrorJsonConverter()); + } + /// + /// Indicates which operations can be performed by the Power BI Resource + /// Provider. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetAvailableOperationsWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "GetAvailableOperations", tracingParameters); + } + // Construct URL + var _baseUrl = BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.PowerBI/operations").ToString(); + List _queryParameters = new List(); + if (ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (GenerateClientRequestId != null && GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + Error _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/PowerBIEmbeddedManagementClientExtensions.cs b/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/PowerBIEmbeddedManagementClientExtensions.cs new file mode 100644 index 000000000000..2dcd4bf43f05 --- /dev/null +++ b/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/PowerBIEmbeddedManagementClientExtensions.cs @@ -0,0 +1,55 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.PowerBIEmbedded +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for PowerBIEmbeddedManagementClient. + /// + public static partial class PowerBIEmbeddedManagementClientExtensions + { + /// + /// Indicates which operations can be performed by the Power BI Resource + /// Provider. + /// + /// + /// The operations group for this extension method. + /// + public static OperationList GetAvailableOperations(this IPowerBIEmbeddedManagementClient operations) + { + return operations.GetAvailableOperationsAsync().GetAwaiter().GetResult(); + } + + /// + /// Indicates which operations can be performed by the Power BI Resource + /// Provider. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async Task GetAvailableOperationsAsync(this IPowerBIEmbeddedManagementClient operations, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetAvailableOperationsWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/SdkInfo_PowerBIEmbeddedManagementClient.cs b/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/SdkInfo_PowerBIEmbeddedManagementClient.cs new file mode 100644 index 000000000000..980b459c99d6 --- /dev/null +++ b/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/SdkInfo_PowerBIEmbeddedManagementClient.cs @@ -0,0 +1,30 @@ + +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.PowerBIEmbedded +{ + using System; + using System.Collections.Generic; + using System.Linq; + + internal static partial class SdkInfo + { + public static IEnumerable> ApiInfo_PowerBIEmbeddedManagementClient + { + get + { + return new Tuple[] + { + new Tuple("PowerBI", "WorkspaceCollections", "2016-01-29"), + new Tuple("PowerBI", "Workspaces", "2016-01-29"), + new Tuple("PowerBI", "getAvailableOperations", "2016-01-29"), + new Tuple("PowerBIEmbeddedManagementClient", "WorkspaceCollections", "2016-01-29"), + }.AsEnumerable(); + } + } + } +} diff --git a/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/WorkspaceCollectionsOperations.cs b/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/WorkspaceCollectionsOperations.cs new file mode 100644 index 000000000000..e39e9b1e4d76 --- /dev/null +++ b/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/WorkspaceCollectionsOperations.cs @@ -0,0 +1,1978 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.PowerBIEmbedded +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// WorkspaceCollectionsOperations operations. + /// + internal partial class WorkspaceCollectionsOperations : IServiceOperations, IWorkspaceCollectionsOperations + { + /// + /// Initializes a new instance of the WorkspaceCollectionsOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal WorkspaceCollectionsOperations(PowerBIEmbeddedManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the PowerBIEmbeddedManagementClient + /// + public PowerBIEmbeddedManagementClient Client { get; private set; } + + /// + /// Retrieves an existing Power BI Workspace Collection. + /// + /// + /// Azure resource group + /// + /// + /// Power BI Embedded Workspace Collection name + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetByNameWithHttpMessagesAsync(string resourceGroupName, string workspaceCollectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (workspaceCollectionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceCollectionName"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceCollectionName", workspaceCollectionName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "GetByName", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBI/workspaceCollections/{workspaceCollectionName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceCollectionName}", System.Uri.EscapeDataString(workspaceCollectionName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + Error _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Creates a new Power BI Workspace Collection with the specified properties. + /// A Power BI Workspace Collection contains one or more workspaces, and can be + /// used to provision keys that provide API access to those workspaces. + /// + /// + /// Azure resource group + /// + /// + /// Power BI Embedded Workspace Collection name + /// + /// + /// Create workspace collection request + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> CreateWithHttpMessagesAsync(string resourceGroupName, string workspaceCollectionName, CreateWorkspaceCollectionRequest body, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (workspaceCollectionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceCollectionName"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (body == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "body"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceCollectionName", workspaceCollectionName); + tracingParameters.Add("body", body); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Create", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBI/workspaceCollections/{workspaceCollectionName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceCollectionName}", System.Uri.EscapeDataString(workspaceCollectionName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(body != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(body, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + Error _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Update an existing Power BI Workspace Collection with the specified + /// properties. + /// + /// + /// Azure resource group + /// + /// + /// Power BI Embedded Workspace Collection name + /// + /// + /// Update workspace collection request + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceCollectionName, UpdateWorkspaceCollectionRequest body, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (workspaceCollectionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceCollectionName"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (body == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "body"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceCollectionName", workspaceCollectionName); + tracingParameters.Add("body", body); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Update", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBI/workspaceCollections/{workspaceCollectionName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceCollectionName}", System.Uri.EscapeDataString(workspaceCollectionName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PATCH"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(body != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(body, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + Error _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Delete a Power BI Workspace Collection. + /// + /// + /// Azure resource group + /// + /// + /// Power BI Embedded Workspace Collection name + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string workspaceCollectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, workspaceCollectionName, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Verify the specified Power BI Workspace Collection name is valid and not + /// already in use. + /// + /// + /// Azure location + /// + /// + /// Check name availability request + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> CheckNameAvailabilityWithHttpMessagesAsync(string location, CheckNameRequest body, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (location == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "location"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (body == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "body"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("location", location); + tracingParameters.Add("body", body); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "CheckNameAvailability", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.PowerBI/locations/{location}/checkNameAvailability").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{location}", System.Uri.EscapeDataString(location)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(body != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(body, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + Error _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Retrieves all existing Power BI workspace collections in the specified + /// resource group. + /// + /// + /// Azure resource group + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroup", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBI/workspaceCollections").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + Error _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Retrieves all existing Power BI workspace collections in the specified + /// subscription. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListBySubscriptionWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListBySubscription", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.PowerBI/workspaceCollections").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + Error _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Retrieves the primary and secondary access keys for the specified Power BI + /// Workspace Collection. + /// + /// + /// Azure resource group + /// + /// + /// Power BI Embedded Workspace Collection name + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetAccessKeysWithHttpMessagesAsync(string resourceGroupName, string workspaceCollectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (workspaceCollectionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceCollectionName"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceCollectionName", workspaceCollectionName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "GetAccessKeys", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBI/workspaceCollections/{workspaceCollectionName}/listKeys").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceCollectionName}", System.Uri.EscapeDataString(workspaceCollectionName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + Error _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Regenerates the primary or secondary access key for the specified Power BI + /// Workspace Collection. + /// + /// + /// Azure resource group + /// + /// + /// Power BI Embedded Workspace Collection name + /// + /// + /// Access key to regenerate + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> RegenerateKeyWithHttpMessagesAsync(string resourceGroupName, string workspaceCollectionName, WorkspaceCollectionAccessKey body, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (workspaceCollectionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceCollectionName"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (body == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "body"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceCollectionName", workspaceCollectionName); + tracingParameters.Add("body", body); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "RegenerateKey", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBI/workspaceCollections/{workspaceCollectionName}/regenerateKey").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceCollectionName}", System.Uri.EscapeDataString(workspaceCollectionName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(body != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(body, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + Error _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Migrates an existing Power BI Workspace Collection to a different resource + /// group and/or subscription. + /// + /// + /// Azure resource group + /// + /// + /// Workspace migration request + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task MigrateWithHttpMessagesAsync(string resourceGroupName, MigrateWorkspaceCollectionRequest body, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (body == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "body"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("body", body); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Migrate", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/moveResources").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(body != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(body, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + Error _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Delete a Power BI Workspace Collection. + /// + /// + /// Azure resource group + /// + /// + /// Power BI Embedded Workspace Collection name + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string workspaceCollectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (workspaceCollectionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceCollectionName"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceCollectionName", workspaceCollectionName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBI/workspaceCollections/{workspaceCollectionName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceCollectionName}", System.Uri.EscapeDataString(workspaceCollectionName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 202) + { + var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + Error _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/WorkspaceCollectionsOperationsExtensions.cs b/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/WorkspaceCollectionsOperationsExtensions.cs new file mode 100644 index 000000000000..dd1d9b917e86 --- /dev/null +++ b/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/WorkspaceCollectionsOperationsExtensions.cs @@ -0,0 +1,476 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.PowerBIEmbedded +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for WorkspaceCollectionsOperations. + /// + public static partial class WorkspaceCollectionsOperationsExtensions + { + /// + /// Retrieves an existing Power BI Workspace Collection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Azure resource group + /// + /// + /// Power BI Embedded Workspace Collection name + /// + public static WorkspaceCollection GetByName(this IWorkspaceCollectionsOperations operations, string resourceGroupName, string workspaceCollectionName) + { + return operations.GetByNameAsync(resourceGroupName, workspaceCollectionName).GetAwaiter().GetResult(); + } + + /// + /// Retrieves an existing Power BI Workspace Collection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Azure resource group + /// + /// + /// Power BI Embedded Workspace Collection name + /// + /// + /// The cancellation token. + /// + public static async Task GetByNameAsync(this IWorkspaceCollectionsOperations operations, string resourceGroupName, string workspaceCollectionName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetByNameWithHttpMessagesAsync(resourceGroupName, workspaceCollectionName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Creates a new Power BI Workspace Collection with the specified properties. + /// A Power BI Workspace Collection contains one or more workspaces, and can be + /// used to provision keys that provide API access to those workspaces. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Azure resource group + /// + /// + /// Power BI Embedded Workspace Collection name + /// + /// + /// Create workspace collection request + /// + public static WorkspaceCollection Create(this IWorkspaceCollectionsOperations operations, string resourceGroupName, string workspaceCollectionName, CreateWorkspaceCollectionRequest body) + { + return operations.CreateAsync(resourceGroupName, workspaceCollectionName, body).GetAwaiter().GetResult(); + } + + /// + /// Creates a new Power BI Workspace Collection with the specified properties. + /// A Power BI Workspace Collection contains one or more workspaces, and can be + /// used to provision keys that provide API access to those workspaces. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Azure resource group + /// + /// + /// Power BI Embedded Workspace Collection name + /// + /// + /// Create workspace collection request + /// + /// + /// The cancellation token. + /// + public static async Task CreateAsync(this IWorkspaceCollectionsOperations operations, string resourceGroupName, string workspaceCollectionName, CreateWorkspaceCollectionRequest body, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.CreateWithHttpMessagesAsync(resourceGroupName, workspaceCollectionName, body, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Update an existing Power BI Workspace Collection with the specified + /// properties. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Azure resource group + /// + /// + /// Power BI Embedded Workspace Collection name + /// + /// + /// Update workspace collection request + /// + public static WorkspaceCollection Update(this IWorkspaceCollectionsOperations operations, string resourceGroupName, string workspaceCollectionName, UpdateWorkspaceCollectionRequest body) + { + return operations.UpdateAsync(resourceGroupName, workspaceCollectionName, body).GetAwaiter().GetResult(); + } + + /// + /// Update an existing Power BI Workspace Collection with the specified + /// properties. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Azure resource group + /// + /// + /// Power BI Embedded Workspace Collection name + /// + /// + /// Update workspace collection request + /// + /// + /// The cancellation token. + /// + public static async Task UpdateAsync(this IWorkspaceCollectionsOperations operations, string resourceGroupName, string workspaceCollectionName, UpdateWorkspaceCollectionRequest body, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, workspaceCollectionName, body, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Delete a Power BI Workspace Collection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Azure resource group + /// + /// + /// Power BI Embedded Workspace Collection name + /// + public static void Delete(this IWorkspaceCollectionsOperations operations, string resourceGroupName, string workspaceCollectionName) + { + operations.DeleteAsync(resourceGroupName, workspaceCollectionName).GetAwaiter().GetResult(); + } + + /// + /// Delete a Power BI Workspace Collection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Azure resource group + /// + /// + /// Power BI Embedded Workspace Collection name + /// + /// + /// The cancellation token. + /// + public static async Task DeleteAsync(this IWorkspaceCollectionsOperations operations, string resourceGroupName, string workspaceCollectionName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, workspaceCollectionName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Verify the specified Power BI Workspace Collection name is valid and not + /// already in use. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Azure location + /// + /// + /// Check name availability request + /// + public static CheckNameResponse CheckNameAvailability(this IWorkspaceCollectionsOperations operations, string location, CheckNameRequest body) + { + return operations.CheckNameAvailabilityAsync(location, body).GetAwaiter().GetResult(); + } + + /// + /// Verify the specified Power BI Workspace Collection name is valid and not + /// already in use. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Azure location + /// + /// + /// Check name availability request + /// + /// + /// The cancellation token. + /// + public static async Task CheckNameAvailabilityAsync(this IWorkspaceCollectionsOperations operations, string location, CheckNameRequest body, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.CheckNameAvailabilityWithHttpMessagesAsync(location, body, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Retrieves all existing Power BI workspace collections in the specified + /// resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Azure resource group + /// + public static IEnumerable ListByResourceGroup(this IWorkspaceCollectionsOperations operations, string resourceGroupName) + { + return operations.ListByResourceGroupAsync(resourceGroupName).GetAwaiter().GetResult(); + } + + /// + /// Retrieves all existing Power BI workspace collections in the specified + /// resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Azure resource group + /// + /// + /// The cancellation token. + /// + public static async Task> ListByResourceGroupAsync(this IWorkspaceCollectionsOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByResourceGroupWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Retrieves all existing Power BI workspace collections in the specified + /// subscription. + /// + /// + /// The operations group for this extension method. + /// + public static IEnumerable ListBySubscription(this IWorkspaceCollectionsOperations operations) + { + return operations.ListBySubscriptionAsync().GetAwaiter().GetResult(); + } + + /// + /// Retrieves all existing Power BI workspace collections in the specified + /// subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async Task> ListBySubscriptionAsync(this IWorkspaceCollectionsOperations operations, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListBySubscriptionWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Retrieves the primary and secondary access keys for the specified Power BI + /// Workspace Collection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Azure resource group + /// + /// + /// Power BI Embedded Workspace Collection name + /// + public static WorkspaceCollectionAccessKeys GetAccessKeys(this IWorkspaceCollectionsOperations operations, string resourceGroupName, string workspaceCollectionName) + { + return operations.GetAccessKeysAsync(resourceGroupName, workspaceCollectionName).GetAwaiter().GetResult(); + } + + /// + /// Retrieves the primary and secondary access keys for the specified Power BI + /// Workspace Collection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Azure resource group + /// + /// + /// Power BI Embedded Workspace Collection name + /// + /// + /// The cancellation token. + /// + public static async Task GetAccessKeysAsync(this IWorkspaceCollectionsOperations operations, string resourceGroupName, string workspaceCollectionName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetAccessKeysWithHttpMessagesAsync(resourceGroupName, workspaceCollectionName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Regenerates the primary or secondary access key for the specified Power BI + /// Workspace Collection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Azure resource group + /// + /// + /// Power BI Embedded Workspace Collection name + /// + /// + /// Access key to regenerate + /// + public static WorkspaceCollectionAccessKeys RegenerateKey(this IWorkspaceCollectionsOperations operations, string resourceGroupName, string workspaceCollectionName, WorkspaceCollectionAccessKey body) + { + return operations.RegenerateKeyAsync(resourceGroupName, workspaceCollectionName, body).GetAwaiter().GetResult(); + } + + /// + /// Regenerates the primary or secondary access key for the specified Power BI + /// Workspace Collection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Azure resource group + /// + /// + /// Power BI Embedded Workspace Collection name + /// + /// + /// Access key to regenerate + /// + /// + /// The cancellation token. + /// + public static async Task RegenerateKeyAsync(this IWorkspaceCollectionsOperations operations, string resourceGroupName, string workspaceCollectionName, WorkspaceCollectionAccessKey body, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.RegenerateKeyWithHttpMessagesAsync(resourceGroupName, workspaceCollectionName, body, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Migrates an existing Power BI Workspace Collection to a different resource + /// group and/or subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Azure resource group + /// + /// + /// Workspace migration request + /// + public static void Migrate(this IWorkspaceCollectionsOperations operations, string resourceGroupName, MigrateWorkspaceCollectionRequest body) + { + operations.MigrateAsync(resourceGroupName, body).GetAwaiter().GetResult(); + } + + /// + /// Migrates an existing Power BI Workspace Collection to a different resource + /// group and/or subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Azure resource group + /// + /// + /// Workspace migration request + /// + /// + /// The cancellation token. + /// + public static async Task MigrateAsync(this IWorkspaceCollectionsOperations operations, string resourceGroupName, MigrateWorkspaceCollectionRequest body, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.MigrateWithHttpMessagesAsync(resourceGroupName, body, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Delete a Power BI Workspace Collection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Azure resource group + /// + /// + /// Power BI Embedded Workspace Collection name + /// + public static void BeginDelete(this IWorkspaceCollectionsOperations operations, string resourceGroupName, string workspaceCollectionName) + { + operations.BeginDeleteAsync(resourceGroupName, workspaceCollectionName).GetAwaiter().GetResult(); + } + + /// + /// Delete a Power BI Workspace Collection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Azure resource group + /// + /// + /// Power BI Embedded Workspace Collection name + /// + /// + /// The cancellation token. + /// + public static async Task BeginDeleteAsync(this IWorkspaceCollectionsOperations operations, string resourceGroupName, string workspaceCollectionName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, workspaceCollectionName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + } +} diff --git a/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/WorkspacesOperations.cs b/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/WorkspacesOperations.cs new file mode 100644 index 000000000000..909ada372186 --- /dev/null +++ b/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/WorkspacesOperations.cs @@ -0,0 +1,246 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.PowerBIEmbedded +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// WorkspacesOperations operations. + /// + internal partial class WorkspacesOperations : IServiceOperations, IWorkspacesOperations + { + /// + /// Initializes a new instance of the WorkspacesOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal WorkspacesOperations(PowerBIEmbeddedManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the PowerBIEmbeddedManagementClient + /// + public PowerBIEmbeddedManagementClient Client { get; private set; } + + /// + /// Retrieves all existing Power BI workspaces in the specified workspace + /// collection. + /// + /// + /// Azure resource group + /// + /// + /// Power BI Embedded Workspace Collection name + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, string workspaceCollectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (workspaceCollectionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceCollectionName"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceCollectionName", workspaceCollectionName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBI/workspaceCollections/{workspaceCollectionName}/workspaces").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceCollectionName}", System.Uri.EscapeDataString(workspaceCollectionName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + Error _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/WorkspacesOperationsExtensions.cs b/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/WorkspacesOperationsExtensions.cs new file mode 100644 index 000000000000..0eb4fc09b661 --- /dev/null +++ b/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/WorkspacesOperationsExtensions.cs @@ -0,0 +1,69 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.PowerBIEmbedded +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for WorkspacesOperations. + /// + public static partial class WorkspacesOperationsExtensions + { + /// + /// Retrieves all existing Power BI workspaces in the specified workspace + /// collection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Azure resource group + /// + /// + /// Power BI Embedded Workspace Collection name + /// + public static IEnumerable List(this IWorkspacesOperations operations, string resourceGroupName, string workspaceCollectionName) + { + return operations.ListAsync(resourceGroupName, workspaceCollectionName).GetAwaiter().GetResult(); + } + + /// + /// Retrieves all existing Power BI workspaces in the specified workspace + /// collection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Azure resource group + /// + /// + /// Power BI Embedded Workspace Collection name + /// + /// + /// The cancellation token. + /// + public static async Task> ListAsync(this IWorkspacesOperations operations, string resourceGroupName, string workspaceCollectionName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, workspaceCollectionName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/PowerBIEmbedded.Management.Sdk.csproj b/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/PowerBIEmbedded.Management.Sdk.csproj new file mode 100644 index 000000000000..9042ebe87949 --- /dev/null +++ b/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/PowerBIEmbedded.Management.Sdk.csproj @@ -0,0 +1,13 @@ + + + PowerBIEmbedded + + + + netstandard2.0 + Microsoft.Azure.PowerShell.PowerBIEmbedded.Management.Sdk + Microsoft.Azure.Management.PowerBIEmbedded + $(NoWarn);CS0108;CS1573 + + + \ No newline at end of file diff --git a/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Properties/AssemblyInfo.cs b/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Properties/AssemblyInfo.cs new file mode 100644 index 000000000000..468033f1db80 --- /dev/null +++ b/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Properties/AssemblyInfo.cs @@ -0,0 +1,29 @@ +// ---------------------------------------------------------------------------------- +// +// Copyright Microsoft Corporation +// 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. +// ---------------------------------------------------------------------------------- + +using System; +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +[assembly: AssemblyTitle("Microsoft Azure Powershell - Power BI Embedded Management SDK")] +[assembly: AssemblyCompany(Microsoft.WindowsAzure.Commands.Common.AzurePowerShell.AssemblyCompany)] +[assembly: AssemblyProduct(Microsoft.WindowsAzure.Commands.Common.AzurePowerShell.AssemblyProduct)] +[assembly: AssemblyCopyright(Microsoft.WindowsAzure.Commands.Common.AzurePowerShell.AssemblyCopyright)] + +[assembly: ComVisible(false)] +[assembly: CLSCompliant(false)] + +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.1.0.0")] \ No newline at end of file diff --git a/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/README.md b/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/README.md new file mode 100644 index 000000000000..ab1842ba5c95 --- /dev/null +++ b/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/README.md @@ -0,0 +1,34 @@ +# Overall +This directory contains management plane service clients of Az.Storage module. + +## Run Generation +In this directory, run AutoRest: +``` +autorest --reset +autorest --use:@microsoft.azure/autorest.csharp@2.3.90 +autorest.cmd README.md --version=v2 +``` + +### AutoRest Configuration +> see https://aka.ms/autorest +``` yaml +csharp: true +clear-output-folder: true +reflect-api-versions: true +openapi-type: arm +azure-arm: true +license-header: MICROSOFT_MIT_NO_VERSION +``` + + + +### +``` yaml +commit: d2bb2feadd0deb1c7212706aa65cab2f56adccc7 +input-file: + - https://github.com/Azure/azure-rest-api-specs/blob/$(commit)/specification/powerbiembedded/resource-manager/Microsoft.PowerBI/stable/2016-01-29/powerbiembedded.json + +output-folder: Generated + +namespace: Microsoft.Azure.Management.PowerBIEmbedded +``` \ No newline at end of file diff --git a/src/PowerBIEmbedded/PowerBIEmbedded.sln b/src/PowerBIEmbedded/PowerBIEmbedded.sln index 352fd724891d..9610ca097762 100644 --- a/src/PowerBIEmbedded/PowerBIEmbedded.sln +++ b/src/PowerBIEmbedded/PowerBIEmbedded.sln @@ -5,38 +5,39 @@ VisualStudioVersion = 17.0.31903.59 MinimumVisualStudioVersion = 10.0.40219.1 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Accounts", "Accounts", "{65142181-54A9-4908-8624-9951869B4997}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Accounts", "..\Accounts\Accounts\Accounts.csproj", "{53DC6945-8393-4423-8DA0-695CFCAAD531}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Accounts", "..\Accounts\Accounts\Accounts.csproj", "{53DC6945-8393-4423-8DA0-695CFCAAD531}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AssemblyLoading", "..\Accounts\AssemblyLoading\AssemblyLoading.csproj", "{66A761BE-AEDF-4725-A510-20D8F4114B25}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AssemblyLoading", "..\Accounts\AssemblyLoading\AssemblyLoading.csproj", "{66A761BE-AEDF-4725-A510-20D8F4114B25}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Authentication.ResourceManager", "..\Accounts\Authentication.ResourceManager\Authentication.ResourceManager.csproj", "{5DCFDE72-BE29-4EE7-A713-BD32CA274FE6}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Authentication.ResourceManager", "..\Accounts\Authentication.ResourceManager\Authentication.ResourceManager.csproj", "{5DCFDE72-BE29-4EE7-A713-BD32CA274FE6}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Authentication", "..\Accounts\Authentication\Authentication.csproj", "{ADB8B07E-E657-41E0-8B69-9EA657A016A6}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Authentication", "..\Accounts\Authentication\Authentication.csproj", "{ADB8B07E-E657-41E0-8B69-9EA657A016A6}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AuthenticationAssemblyLoadContext", "..\Accounts\AuthenticationAssemblyLoadContext\AuthenticationAssemblyLoadContext.csproj", "{3644A074-9F7D-4196-94ED-33A947A7D1C7}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AuthenticationAssemblyLoadContext", "..\Accounts\AuthenticationAssemblyLoadContext\AuthenticationAssemblyLoadContext.csproj", "{3644A074-9F7D-4196-94ED-33A947A7D1C7}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Authenticators", "..\Accounts\Authenticators\Authenticators.csproj", "{C1FC9720-3FBD-4F61-BFC0-2D3ED1B8093A}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Authenticators", "..\Accounts\Authenticators\Authenticators.csproj", "{C1FC9720-3FBD-4F61-BFC0-2D3ED1B8093A}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Test", "Test", "{63A63F4C-005D-46B1-97B2-BA1CF29B6A15}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PowerBI.Test", "PowerBI.Test\PowerBI.Test.csproj", "{F7312B0E-ECFC-4C2B-BA34-800F7452866D}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PowerBI.Test", "PowerBI.Test\PowerBI.Test.csproj", "{F7312B0E-ECFC-4C2B-BA34-800F7452866D}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PowerBI", "PowerBI\PowerBI.csproj", "{7FDA4392-6FB3-408D-A3DD-873AC69C0161}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PowerBI", "PowerBI\PowerBI.csproj", "{7FDA4392-6FB3-408D-A3DD-873AC69C0161}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PowerBIEmbedded.Test", "PowerBIEmbedded.Test\PowerBIEmbedded.Test.csproj", "{930D677A-D08F-4223-A977-80C7F0E589FD}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PowerBIEmbedded.Test", "PowerBIEmbedded.Test\PowerBIEmbedded.Test.csproj", "{930D677A-D08F-4223-A977-80C7F0E589FD}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PowerBIEmbedded", "PowerBIEmbedded\PowerBIEmbedded.csproj", "{49278376-BF51-4280-9050-E925AEBC5B40}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PowerBIEmbedded", "PowerBIEmbedded\PowerBIEmbedded.csproj", "{49278376-BF51-4280-9050-E925AEBC5B40}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestFx", "..\..\tools\TestFx\TestFx.csproj", "{300C47B5-2E1E-4676-8DD4-3E9C3660AED8}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TestFx", "..\..\tools\TestFx\TestFx.csproj", "{300C47B5-2E1E-4676-8DD4-3E9C3660AED8}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PowerBIEmbedded.Management.Sdk", "PowerBIEmbedded.Management.Sdk\PowerBIEmbedded.Management.Sdk.csproj", "{600B336F-4D21-4264-AD1A-1BD8C75ECDE2}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PowerBIDedicated.Management.Sdk", "PowerBIDedicated.Management.Sdk\PowerBIDedicated.Management.Sdk.csproj", "{C725AC88-2EFC-4D8D-A3B3-ABA09B58C1B8}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU Release|Any CPU = Release|Any CPU EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {53DC6945-8393-4423-8DA0-695CFCAAD531}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {53DC6945-8393-4423-8DA0-695CFCAAD531}.Debug|Any CPU.Build.0 = Debug|Any CPU @@ -82,6 +83,17 @@ Global {300C47B5-2E1E-4676-8DD4-3E9C3660AED8}.Debug|Any CPU.Build.0 = Debug|Any CPU {300C47B5-2E1E-4676-8DD4-3E9C3660AED8}.Release|Any CPU.ActiveCfg = Release|Any CPU {300C47B5-2E1E-4676-8DD4-3E9C3660AED8}.Release|Any CPU.Build.0 = Release|Any CPU + {600B336F-4D21-4264-AD1A-1BD8C75ECDE2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {600B336F-4D21-4264-AD1A-1BD8C75ECDE2}.Debug|Any CPU.Build.0 = Debug|Any CPU + {600B336F-4D21-4264-AD1A-1BD8C75ECDE2}.Release|Any CPU.ActiveCfg = Release|Any CPU + {600B336F-4D21-4264-AD1A-1BD8C75ECDE2}.Release|Any CPU.Build.0 = Release|Any CPU + {C725AC88-2EFC-4D8D-A3B3-ABA09B58C1B8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C725AC88-2EFC-4D8D-A3B3-ABA09B58C1B8}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C725AC88-2EFC-4D8D-A3B3-ABA09B58C1B8}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C725AC88-2EFC-4D8D-A3B3-ABA09B58C1B8}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE EndGlobalSection GlobalSection(NestedProjects) = preSolution {53DC6945-8393-4423-8DA0-695CFCAAD531} = {65142181-54A9-4908-8624-9951869B4997} diff --git a/src/PowerBIEmbedded/PowerBIEmbedded/Az.PowerBIEmbedded.psd1 b/src/PowerBIEmbedded/PowerBIEmbedded/Az.PowerBIEmbedded.psd1 index d4d98ccb28ba..e77b692c8844 100644 --- a/src/PowerBIEmbedded/PowerBIEmbedded/Az.PowerBIEmbedded.psd1 +++ b/src/PowerBIEmbedded/PowerBIEmbedded/Az.PowerBIEmbedded.psd1 @@ -56,8 +56,8 @@ DotNetFrameworkVersion = '4.7.2' RequiredModules = @(@{ModuleName = 'Az.Accounts'; ModuleVersion = '2.13.2'; }) # Assemblies that must be loaded prior to importing this module -RequiredAssemblies = 'Microsoft.Azure.Management.PowerBIDedicated.dll', - 'Microsoft.Azure.Management.PowerBIEmbedded.dll' +RequiredAssemblies = 'Microsoft.Azure.PowerShell.PowerBIDedicated.Management.Sdk.dll', + 'Microsoft.Azure.PowerShell.PowerBIEmbedded.Management.Sdk.dll' # Script files (.ps1) that are run in the caller's environment prior to importing this module. ScriptsToProcess = @() diff --git a/src/PowerBIEmbedded/PowerBIEmbedded/PowerBIEmbedded.csproj b/src/PowerBIEmbedded/PowerBIEmbedded/PowerBIEmbedded.csproj index cf544f41275a..893ab041b7f6 100644 --- a/src/PowerBIEmbedded/PowerBIEmbedded/PowerBIEmbedded.csproj +++ b/src/PowerBIEmbedded/PowerBIEmbedded/PowerBIEmbedded.csproj @@ -10,10 +10,10 @@ $(LegacyAssemblyPrefix)Management.$(PsModuleName) + + - + - - From b028bd0935146f94a96cfbfe3e82e13b2b53fa89 Mon Sep 17 00:00:00 2001 From: JoyerJin <116236375+JoyerJin@users.noreply.github.com> Date: Wed, 20 Nov 2024 16:23:18 +0800 Subject: [PATCH 2/3] generated migration csharp to powershell --- .../PowerBI/Models/PowerBIClient.cs | 2 +- .../Generated/CapacitiesOperations.cs | 1248 ++++++++-------- .../CapacitiesOperationsExtensions.cs | 1254 ++++++++--------- .../Generated/ICapacitiesOperations.cs | 293 ++-- .../Generated/IOperations.cs | 38 +- .../IPowerBIDedicatedManagementClient.cs | 55 +- .../Generated/Models/DedicatedCapacity.cs | 122 +- .../Models/DedicatedCapacityAdministrators.cs | 36 +- .../DedicatedCapacityMutableProperties.cs | 49 + .../Models/DedicatedCapacityProperties.cs | 70 + .../DedicatedCapacityUpdateParameters.cs | 70 +- .../Generated/Models/ErrorResponse.cs | 36 +- .../Models/ErrorResponseException.cs | 25 +- .../Generated/Models/Operation.cs | 37 +- .../Generated/Models/OperationDisplay.cs | 48 +- .../Generated/Models/Page.cs | 74 +- .../Generated/Models/Page1.cs | 74 +- .../Generated/Models/ProvisioningState.cs | 13 +- .../Generated/Models/Resource.cs | 108 +- .../Generated/Models/ResourceSku.cs | 48 +- .../Models/SkuDetailsForExistingResource.cs | 38 +- ...SkuEnumerationForExistingResourceResult.cs | 39 +- .../SkuEnumerationForNewResourceResult.cs | 36 +- .../Generated/Models/SkuTier.cs | 15 +- .../Generated/Models/State.cs | 13 +- .../Generated/Operations.cs | 199 +-- .../Generated/OperationsExtensions.cs | 125 +- .../PowerBIDedicatedManagementClient.cs | 196 ++- .../Generated/SdkInfo_PowerBIDedicated.cs | 28 - .../PowerBIDedicated.Management.Sdk/README.md | 7 +- .../IPowerBIEmbeddedManagementClient.cs | 77 +- .../IWorkspaceCollectionsOperations.cs | 177 +-- .../Generated/IWorkspacesOperations.cs | 32 +- .../Generated/Models/AccessKeyName.cs | 25 +- .../Generated/Models/AzureSku.cs | 32 +- .../Generated/Models/AzureSkuName.cs | 18 + .../Generated/Models/AzureSkuTier.cs | 18 + .../Generated/Models/CheckNameReason.cs | 13 +- .../Generated/Models/CheckNameRequest.cs | 35 +- .../Generated/Models/CheckNameResponse.cs | 64 +- .../CreateWorkspaceCollectionRequest.cs | 61 +- .../Generated/Models/Display.cs | 126 +- .../Generated/Models/Error.cs | 59 +- .../Generated/Models/ErrorDetail.cs | 45 +- .../Generated/Models/ErrorException.cs | 22 +- .../MigrateWorkspaceCollectionRequest.cs | 51 +- .../Generated/Models/Operation.cs | 44 +- .../Generated/Models/OperationList.cs | 29 +- .../Generated/Models/Page.cs | 74 +- .../UpdateWorkspaceCollectionRequest.cs | 51 +- .../Generated/Models/Workspace.cs | 55 +- .../Generated/Models/WorkspaceCollection.cs | 97 +- .../Models/WorkspaceCollectionAccessKey.cs | 34 +- .../Models/WorkspaceCollectionAccessKeys.cs | 41 +- .../PowerBIEmbeddedManagementClient.cs | 288 ++-- ...werBIEmbeddedManagementClientExtensions.cs | 68 +- ...SdkInfo_PowerBIEmbeddedManagementClient.cs | 30 - .../WorkspaceCollectionsOperations.cs | 1117 ++++++++------- ...orkspaceCollectionsOperationsExtensions.cs | 820 +++++------ .../Generated/WorkspacesOperations.cs | 133 +- .../WorkspacesOperationsExtensions.cs | 94 +- .../PowerBIEmbedded.Management.Sdk/README.md | 7 +- 62 files changed, 4167 insertions(+), 4066 deletions(-) create mode 100644 src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/Models/DedicatedCapacityMutableProperties.cs create mode 100644 src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/Models/DedicatedCapacityProperties.cs delete mode 100644 src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/SdkInfo_PowerBIDedicated.cs create mode 100644 src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/Models/AzureSkuName.cs create mode 100644 src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/Models/AzureSkuTier.cs delete mode 100644 src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/SdkInfo_PowerBIEmbeddedManagementClient.cs diff --git a/src/PowerBIEmbedded/PowerBI/Models/PowerBIClient.cs b/src/PowerBIEmbedded/PowerBI/Models/PowerBIClient.cs index a2e712248913..e36d7aa999f3 100644 --- a/src/PowerBIEmbedded/PowerBI/Models/PowerBIClient.cs +++ b/src/PowerBIEmbedded/PowerBI/Models/PowerBIClient.cs @@ -203,7 +203,7 @@ private string GetResourceGroupByCapacity(string capacityName) private ResourceSku GetResourceSkuFromName(string skuName) { - var tier = skuName.StartsWith("A") ? SkuTier.PBIEAzure : null; + var tier = skuName.StartsWith("A") ? SkuTier.PbieAzure : null; return new ResourceSku(skuName, tier); } diff --git a/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/CapacitiesOperations.cs b/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/CapacitiesOperations.cs index 927c2afbfbe8..886295f00b7b 100644 --- a/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/CapacitiesOperations.cs +++ b/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/CapacitiesOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.PowerBIDedicated { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// CapacitiesOperations operations. /// - internal partial class CapacitiesOperations : IServiceOperations, ICapacitiesOperations + internal partial class CapacitiesOperations : Microsoft.Rest.IServiceOperations, ICapacitiesOperations { /// /// Initializes a new instance of the CapacitiesOperations class. @@ -36,13 +24,13 @@ internal partial class CapacitiesOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal CapacitiesOperations(PowerBIDedicatedManagementClient client) + internal CapacitiesOperations (PowerBIDedicatedManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -68,13 +56,13 @@ internal CapacitiesOperations(PowerBIDedicatedManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -83,101 +71,110 @@ internal CapacitiesOperations(PowerBIDedicatedManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetDetailsWithHttpMessagesAsync(string resourceGroupName, string dedicatedCapacityName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetDetailsWithHttpMessagesAsync(string resourceGroupName, string dedicatedCapacityName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); } } if (dedicatedCapacityName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "dedicatedCapacityName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "dedicatedCapacityName"); } if (dedicatedCapacityName != null) { if (dedicatedCapacityName.Length > 63) { - throw new ValidationException(ValidationRules.MaxLength, "dedicatedCapacityName", 63); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "dedicatedCapacityName", 63); } if (dedicatedCapacityName.Length < 3) { - throw new ValidationException(ValidationRules.MinLength, "dedicatedCapacityName", 3); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "dedicatedCapacityName", 3); } if (!System.Text.RegularExpressions.Regex.IsMatch(dedicatedCapacityName, "^[a-z][a-z0-9]*$")) { - throw new ValidationException(ValidationRules.Pattern, "dedicatedCapacityName", "^[a-z][a-z0-9]*$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "dedicatedCapacityName", "^[a-z][a-z0-9]*$"); } } - if (Client.ApiVersion == null) + if (this.Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("dedicatedCapacityName", dedicatedCapacityName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetDetails", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "GetDetails", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBIDedicated/capacities/{dedicatedCapacityName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{dedicatedCapacityName}", System.Uri.EscapeDataString(dedicatedCapacityName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -189,55 +186,56 @@ internal CapacitiesOperations(PowerBIDedicatedManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -247,9 +245,10 @@ internal CapacitiesOperations(PowerBIDedicatedManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -260,25 +259,29 @@ internal CapacitiesOperations(PowerBIDedicatedManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Provisions the specified Dedicated capacity based on the configuration /// specified in the request. @@ -296,16 +299,16 @@ internal CapacitiesOperations(PowerBIDedicatedManagementClient client) /// Contains the information used to provision the Dedicated capacity. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> CreateWithHttpMessagesAsync(string resourceGroupName, string dedicatedCapacityName, DedicatedCapacity capacityParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateWithHttpMessagesAsync(string resourceGroupName, string dedicatedCapacityName, DedicatedCapacity capacityParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send Request - AzureOperationResponse _response = await BeginCreateWithHttpMessagesAsync(resourceGroupName, dedicatedCapacityName, capacityParameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateWithHttpMessagesAsync(resourceGroupName, dedicatedCapacityName, capacityParameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -321,16 +324,16 @@ internal CapacitiesOperations(PowerBIDedicatedManagementClient client) /// length, and no more than 63. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string dedicatedCapacityName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string dedicatedCapacityName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, dedicatedCapacityName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, dedicatedCapacityName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -349,16 +352,16 @@ internal CapacitiesOperations(PowerBIDedicatedManagementClient client) /// Request object that contains the updated information for the capacity. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string dedicatedCapacityName, DedicatedCapacityUpdateParameters capacityUpdateParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string dedicatedCapacityName, DedicatedCapacityUpdateParameters capacityUpdateParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send Request - AzureOperationResponse _response = await BeginUpdateWithHttpMessagesAsync(resourceGroupName, dedicatedCapacityName, capacityUpdateParameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginUpdateWithHttpMessagesAsync(resourceGroupName, dedicatedCapacityName, capacityUpdateParameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -374,16 +377,16 @@ internal CapacitiesOperations(PowerBIDedicatedManagementClient client) /// length, and no more than 63. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task SuspendWithHttpMessagesAsync(string resourceGroupName, string dedicatedCapacityName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task SuspendWithHttpMessagesAsync(string resourceGroupName, string dedicatedCapacityName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginSuspendWithHttpMessagesAsync(resourceGroupName, dedicatedCapacityName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginSuspendWithHttpMessagesAsync(resourceGroupName, dedicatedCapacityName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -399,16 +402,16 @@ internal CapacitiesOperations(PowerBIDedicatedManagementClient client) /// length, and no more than 63. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task ResumeWithHttpMessagesAsync(string resourceGroupName, string dedicatedCapacityName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task ResumeWithHttpMessagesAsync(string resourceGroupName, string dedicatedCapacityName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginResumeWithHttpMessagesAsync(resourceGroupName, dedicatedCapacityName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginResumeWithHttpMessagesAsync(resourceGroupName, dedicatedCapacityName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -425,13 +428,13 @@ internal CapacitiesOperations(PowerBIDedicatedManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -440,80 +443,89 @@ internal CapacitiesOperations(PowerBIDedicatedManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); } } - if (Client.ApiVersion == null) + if (this.Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroup", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroup", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBIDedicated/capacities").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -525,55 +537,56 @@ internal CapacitiesOperations(PowerBIDedicatedManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -583,9 +596,10 @@ internal CapacitiesOperations(PowerBIDedicatedManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -596,25 +610,29 @@ internal CapacitiesOperations(PowerBIDedicatedManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Lists all the Dedicated capacities for the given subscription. /// @@ -624,13 +642,13 @@ internal CapacitiesOperations(PowerBIDedicatedManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -639,59 +657,68 @@ internal CapacitiesOperations(PowerBIDedicatedManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.ApiVersion == null) + + + + + if (this.Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.PowerBIDedicated/capacities").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -703,55 +730,56 @@ internal CapacitiesOperations(PowerBIDedicatedManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -761,9 +789,10 @@ internal CapacitiesOperations(PowerBIDedicatedManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -774,25 +803,29 @@ internal CapacitiesOperations(PowerBIDedicatedManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Lists eligible SKUs for PowerBI Dedicated resource provider. /// @@ -802,13 +835,13 @@ internal CapacitiesOperations(PowerBIDedicatedManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -817,59 +850,68 @@ internal CapacitiesOperations(PowerBIDedicatedManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ListSkusWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> ListSkusWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.ApiVersion == null) + + + + + if (this.Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListSkus", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListSkus", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.PowerBIDedicated/skus").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -881,55 +923,56 @@ internal CapacitiesOperations(PowerBIDedicatedManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -939,9 +982,10 @@ internal CapacitiesOperations(PowerBIDedicatedManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -952,25 +996,29 @@ internal CapacitiesOperations(PowerBIDedicatedManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Lists eligible SKUs for a PowerBI Dedicated resource. /// @@ -989,13 +1037,13 @@ internal CapacitiesOperations(PowerBIDedicatedManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1004,101 +1052,110 @@ internal CapacitiesOperations(PowerBIDedicatedManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ListSkusForCapacityWithHttpMessagesAsync(string resourceGroupName, string dedicatedCapacityName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> ListSkusForCapacityWithHttpMessagesAsync(string resourceGroupName, string dedicatedCapacityName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); } } if (dedicatedCapacityName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "dedicatedCapacityName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "dedicatedCapacityName"); } if (dedicatedCapacityName != null) { if (dedicatedCapacityName.Length > 63) { - throw new ValidationException(ValidationRules.MaxLength, "dedicatedCapacityName", 63); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "dedicatedCapacityName", 63); } if (dedicatedCapacityName.Length < 3) { - throw new ValidationException(ValidationRules.MinLength, "dedicatedCapacityName", 3); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "dedicatedCapacityName", 3); } if (!System.Text.RegularExpressions.Regex.IsMatch(dedicatedCapacityName, "^[a-z][a-z0-9]*$")) { - throw new ValidationException(ValidationRules.Pattern, "dedicatedCapacityName", "^[a-z][a-z0-9]*$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "dedicatedCapacityName", "^[a-z][a-z0-9]*$"); } } - if (Client.ApiVersion == null) + if (this.Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("dedicatedCapacityName", dedicatedCapacityName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListSkusForCapacity", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListSkusForCapacity", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBIDedicated/capacities/{dedicatedCapacityName}/skus").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{dedicatedCapacityName}", System.Uri.EscapeDataString(dedicatedCapacityName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1110,55 +1167,56 @@ internal CapacitiesOperations(PowerBIDedicatedManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1168,9 +1226,10 @@ internal CapacitiesOperations(PowerBIDedicatedManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1181,25 +1240,29 @@ internal CapacitiesOperations(PowerBIDedicatedManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Provisions the specified Dedicated capacity based on the configuration /// specified in the request. @@ -1222,13 +1285,13 @@ internal CapacitiesOperations(PowerBIDedicatedManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1237,110 +1300,119 @@ internal CapacitiesOperations(PowerBIDedicatedManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateWithHttpMessagesAsync(string resourceGroupName, string dedicatedCapacityName, DedicatedCapacity capacityParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginCreateWithHttpMessagesAsync(string resourceGroupName, string dedicatedCapacityName, DedicatedCapacity capacityParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + + if (capacityParameters == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "capacityParameters"); + } + if (capacityParameters != null) + { + capacityParameters.Validate(); + } if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); } } if (dedicatedCapacityName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "dedicatedCapacityName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "dedicatedCapacityName"); } if (dedicatedCapacityName != null) { if (dedicatedCapacityName.Length > 63) { - throw new ValidationException(ValidationRules.MaxLength, "dedicatedCapacityName", 63); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "dedicatedCapacityName", 63); } if (dedicatedCapacityName.Length < 3) { - throw new ValidationException(ValidationRules.MinLength, "dedicatedCapacityName", 3); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "dedicatedCapacityName", 3); } if (!System.Text.RegularExpressions.Regex.IsMatch(dedicatedCapacityName, "^[a-z][a-z0-9]*$")) { - throw new ValidationException(ValidationRules.Pattern, "dedicatedCapacityName", "^[a-z][a-z0-9]*$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "dedicatedCapacityName", "^[a-z][a-z0-9]*$"); } } - if (capacityParameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "capacityParameters"); - } - if (capacityParameters != null) - { - capacityParameters.Validate(); - } - if (Client.ApiVersion == null) + if (this.Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("dedicatedCapacityName", dedicatedCapacityName); + tracingParameters.Add("capacityParameters", capacityParameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreate", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBIDedicated/capacities/{dedicatedCapacityName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{dedicatedCapacityName}", System.Uri.EscapeDataString(dedicatedCapacityName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1352,61 +1424,62 @@ internal CapacitiesOperations(PowerBIDedicatedManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(capacityParameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(capacityParameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(capacityParameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1416,9 +1489,10 @@ internal CapacitiesOperations(PowerBIDedicatedManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1429,16 +1503,16 @@ internal CapacitiesOperations(PowerBIDedicatedManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } // Deserialize Response @@ -1447,25 +1521,29 @@ internal CapacitiesOperations(PowerBIDedicatedManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Deletes the specified Dedicated capacity. /// @@ -1484,10 +1562,10 @@ internal CapacitiesOperations(PowerBIDedicatedManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1496,101 +1574,110 @@ internal CapacitiesOperations(PowerBIDedicatedManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string dedicatedCapacityName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string dedicatedCapacityName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); } } if (dedicatedCapacityName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "dedicatedCapacityName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "dedicatedCapacityName"); } if (dedicatedCapacityName != null) { if (dedicatedCapacityName.Length > 63) { - throw new ValidationException(ValidationRules.MaxLength, "dedicatedCapacityName", 63); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "dedicatedCapacityName", 63); } if (dedicatedCapacityName.Length < 3) { - throw new ValidationException(ValidationRules.MinLength, "dedicatedCapacityName", 3); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "dedicatedCapacityName", 3); } if (!System.Text.RegularExpressions.Regex.IsMatch(dedicatedCapacityName, "^[a-z][a-z0-9]*$")) { - throw new ValidationException(ValidationRules.Pattern, "dedicatedCapacityName", "^[a-z][a-z0-9]*$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "dedicatedCapacityName", "^[a-z][a-z0-9]*$"); } } - if (Client.ApiVersion == null) + if (this.Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("dedicatedCapacityName", dedicatedCapacityName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBIDedicated/capacities/{dedicatedCapacityName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{dedicatedCapacityName}", System.Uri.EscapeDataString(dedicatedCapacityName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1602,55 +1689,56 @@ internal CapacitiesOperations(PowerBIDedicatedManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1660,20 +1748,25 @@ internal CapacitiesOperations(PowerBIDedicatedManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Updates the current state of the specified Dedicated capacity. /// @@ -1695,13 +1788,13 @@ internal CapacitiesOperations(PowerBIDedicatedManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1710,106 +1803,115 @@ internal CapacitiesOperations(PowerBIDedicatedManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string dedicatedCapacityName, DedicatedCapacityUpdateParameters capacityUpdateParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string dedicatedCapacityName, DedicatedCapacityUpdateParameters capacityUpdateParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + + if (capacityUpdateParameters == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "capacityUpdateParameters"); + } if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); } } if (dedicatedCapacityName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "dedicatedCapacityName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "dedicatedCapacityName"); } if (dedicatedCapacityName != null) { if (dedicatedCapacityName.Length > 63) { - throw new ValidationException(ValidationRules.MaxLength, "dedicatedCapacityName", 63); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "dedicatedCapacityName", 63); } if (dedicatedCapacityName.Length < 3) { - throw new ValidationException(ValidationRules.MinLength, "dedicatedCapacityName", 3); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "dedicatedCapacityName", 3); } if (!System.Text.RegularExpressions.Regex.IsMatch(dedicatedCapacityName, "^[a-z][a-z0-9]*$")) { - throw new ValidationException(ValidationRules.Pattern, "dedicatedCapacityName", "^[a-z][a-z0-9]*$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "dedicatedCapacityName", "^[a-z][a-z0-9]*$"); } } - if (capacityUpdateParameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "capacityUpdateParameters"); - } - if (Client.ApiVersion == null) + if (this.Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("dedicatedCapacityName", dedicatedCapacityName); + tracingParameters.Add("capacityUpdateParameters", capacityUpdateParameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginUpdate", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBIDedicated/capacities/{dedicatedCapacityName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{dedicatedCapacityName}", System.Uri.EscapeDataString(dedicatedCapacityName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1821,61 +1923,62 @@ internal CapacitiesOperations(PowerBIDedicatedManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(capacityUpdateParameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(capacityUpdateParameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(capacityUpdateParameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1885,9 +1988,10 @@ internal CapacitiesOperations(PowerBIDedicatedManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1898,16 +2002,16 @@ internal CapacitiesOperations(PowerBIDedicatedManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } // Deserialize Response @@ -1916,25 +2020,29 @@ internal CapacitiesOperations(PowerBIDedicatedManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Suspends operation of the specified dedicated capacity instance. /// @@ -1953,10 +2061,10 @@ internal CapacitiesOperations(PowerBIDedicatedManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1965,101 +2073,110 @@ internal CapacitiesOperations(PowerBIDedicatedManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginSuspendWithHttpMessagesAsync(string resourceGroupName, string dedicatedCapacityName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginSuspendWithHttpMessagesAsync(string resourceGroupName, string dedicatedCapacityName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); } } if (dedicatedCapacityName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "dedicatedCapacityName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "dedicatedCapacityName"); } if (dedicatedCapacityName != null) { if (dedicatedCapacityName.Length > 63) { - throw new ValidationException(ValidationRules.MaxLength, "dedicatedCapacityName", 63); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "dedicatedCapacityName", 63); } if (dedicatedCapacityName.Length < 3) { - throw new ValidationException(ValidationRules.MinLength, "dedicatedCapacityName", 3); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "dedicatedCapacityName", 3); } if (!System.Text.RegularExpressions.Regex.IsMatch(dedicatedCapacityName, "^[a-z][a-z0-9]*$")) { - throw new ValidationException(ValidationRules.Pattern, "dedicatedCapacityName", "^[a-z][a-z0-9]*$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "dedicatedCapacityName", "^[a-z][a-z0-9]*$"); } } - if (Client.ApiVersion == null) + if (this.Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("dedicatedCapacityName", dedicatedCapacityName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginSuspend", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginSuspend", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBIDedicated/capacities/{dedicatedCapacityName}/suspend").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{dedicatedCapacityName}", System.Uri.EscapeDataString(dedicatedCapacityName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -2071,55 +2188,56 @@ internal CapacitiesOperations(PowerBIDedicatedManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -2129,20 +2247,25 @@ internal CapacitiesOperations(PowerBIDedicatedManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Resumes operation of the specified Dedicated capacity instance. /// @@ -2161,10 +2284,10 @@ internal CapacitiesOperations(PowerBIDedicatedManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -2173,101 +2296,110 @@ internal CapacitiesOperations(PowerBIDedicatedManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginResumeWithHttpMessagesAsync(string resourceGroupName, string dedicatedCapacityName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginResumeWithHttpMessagesAsync(string resourceGroupName, string dedicatedCapacityName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); } } if (dedicatedCapacityName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "dedicatedCapacityName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "dedicatedCapacityName"); } if (dedicatedCapacityName != null) { if (dedicatedCapacityName.Length > 63) { - throw new ValidationException(ValidationRules.MaxLength, "dedicatedCapacityName", 63); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "dedicatedCapacityName", 63); } if (dedicatedCapacityName.Length < 3) { - throw new ValidationException(ValidationRules.MinLength, "dedicatedCapacityName", 3); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "dedicatedCapacityName", 3); } if (!System.Text.RegularExpressions.Regex.IsMatch(dedicatedCapacityName, "^[a-z][a-z0-9]*$")) { - throw new ValidationException(ValidationRules.Pattern, "dedicatedCapacityName", "^[a-z][a-z0-9]*$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "dedicatedCapacityName", "^[a-z][a-z0-9]*$"); } } - if (Client.ApiVersion == null) + if (this.Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("dedicatedCapacityName", dedicatedCapacityName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginResume", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginResume", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBIDedicated/capacities/{dedicatedCapacityName}/resume").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{dedicatedCapacityName}", System.Uri.EscapeDataString(dedicatedCapacityName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -2279,55 +2411,56 @@ internal CapacitiesOperations(PowerBIDedicatedManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -2337,19 +2470,24 @@ internal CapacitiesOperations(PowerBIDedicatedManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/CapacitiesOperationsExtensions.cs b/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/CapacitiesOperationsExtensions.cs index 10a9a5f779ef..d8edaa044692 100644 --- a/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/CapacitiesOperationsExtensions.cs +++ b/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/CapacitiesOperationsExtensions.cs @@ -1,683 +1,633 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.PowerBIDedicated { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for CapacitiesOperations. + /// Extension methods for CapacitiesOperations /// public static partial class CapacitiesOperationsExtensions { - /// - /// Gets details about the specified dedicated capacity. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the Azure Resource group of which a given PowerBIDedicated - /// capacity is part. This name must be at least 1 character in length, and no - /// more than 90. - /// - /// - /// The name of the dedicated capacity. It must be a minimum of 3 characters, - /// and a maximum of 63. - /// - public static DedicatedCapacity GetDetails(this ICapacitiesOperations operations, string resourceGroupName, string dedicatedCapacityName) + /// + /// Gets details about the specified dedicated capacity. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the Azure Resource group of which a given PowerBIDedicated + /// capacity is part. This name must be at least 1 character in length, and no + /// more than 90. + /// + /// + /// The name of the dedicated capacity. It must be a minimum of 3 characters, + /// and a maximum of 63. + /// + public static DedicatedCapacity GetDetails(this ICapacitiesOperations operations, string resourceGroupName, string dedicatedCapacityName) + { + return ((ICapacitiesOperations)operations).GetDetailsAsync(resourceGroupName, dedicatedCapacityName).GetAwaiter().GetResult(); + } + + /// + /// Gets details about the specified dedicated capacity. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the Azure Resource group of which a given PowerBIDedicated + /// capacity is part. This name must be at least 1 character in length, and no + /// more than 90. + /// + /// + /// The name of the dedicated capacity. It must be a minimum of 3 characters, + /// and a maximum of 63. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetDetailsAsync(this ICapacitiesOperations operations, string resourceGroupName, string dedicatedCapacityName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetDetailsWithHttpMessagesAsync(resourceGroupName, dedicatedCapacityName, null, cancellationToken).ConfigureAwait(false)) { - return operations.GetDetailsAsync(resourceGroupName, dedicatedCapacityName).GetAwaiter().GetResult(); + return _result.Body; } - - /// - /// Gets details about the specified dedicated capacity. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the Azure Resource group of which a given PowerBIDedicated - /// capacity is part. This name must be at least 1 character in length, and no - /// more than 90. - /// - /// - /// The name of the dedicated capacity. It must be a minimum of 3 characters, - /// and a maximum of 63. - /// - /// - /// The cancellation token. - /// - public static async Task GetDetailsAsync(this ICapacitiesOperations operations, string resourceGroupName, string dedicatedCapacityName, CancellationToken cancellationToken = default(CancellationToken)) + } + /// + /// Provisions the specified Dedicated capacity based on the configuration + /// specified in the request. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the Azure Resource group of which a given PowerBIDedicated + /// capacity is part. This name must be at least 1 character in length, and no + /// more than 90. + /// + /// + /// The name of the Dedicated capacity. It must be a minimum of 3 characters, + /// and a maximum of 63. + /// + public static DedicatedCapacity Create(this ICapacitiesOperations operations, string resourceGroupName, string dedicatedCapacityName, DedicatedCapacity capacityParameters) + { + return ((ICapacitiesOperations)operations).CreateAsync(resourceGroupName, dedicatedCapacityName, capacityParameters).GetAwaiter().GetResult(); + } + + /// + /// Provisions the specified Dedicated capacity based on the configuration + /// specified in the request. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the Azure Resource group of which a given PowerBIDedicated + /// capacity is part. This name must be at least 1 character in length, and no + /// more than 90. + /// + /// + /// The name of the Dedicated capacity. It must be a minimum of 3 characters, + /// and a maximum of 63. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateAsync(this ICapacitiesOperations operations, string resourceGroupName, string dedicatedCapacityName, DedicatedCapacity capacityParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateWithHttpMessagesAsync(resourceGroupName, dedicatedCapacityName, capacityParameters, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.GetDetailsWithHttpMessagesAsync(resourceGroupName, dedicatedCapacityName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } - - /// - /// Provisions the specified Dedicated capacity based on the configuration - /// specified in the request. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the Azure Resource group of which a given PowerBIDedicated - /// capacity is part. This name must be at least 1 character in length, and no - /// more than 90. - /// - /// - /// The name of the Dedicated capacity. It must be a minimum of 3 characters, - /// and a maximum of 63. - /// - /// - /// Contains the information used to provision the Dedicated capacity. - /// - public static DedicatedCapacity Create(this ICapacitiesOperations operations, string resourceGroupName, string dedicatedCapacityName, DedicatedCapacity capacityParameters) + } + /// + /// Deletes the specified Dedicated capacity. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the Azure Resource group of which a given PowerBIDedicated + /// capacity is part. This name must be at least 1 character in length, and no + /// more than 90. + /// + /// + /// The name of the Dedicated capacity. It must be at least 3 characters in + /// length, and no more than 63. + /// + public static void Delete(this ICapacitiesOperations operations, string resourceGroupName, string dedicatedCapacityName) + { + ((ICapacitiesOperations)operations).DeleteAsync(resourceGroupName, dedicatedCapacityName).GetAwaiter().GetResult(); + } + + /// + /// Deletes the specified Dedicated capacity. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the Azure Resource group of which a given PowerBIDedicated + /// capacity is part. This name must be at least 1 character in length, and no + /// more than 90. + /// + /// + /// The name of the Dedicated capacity. It must be at least 3 characters in + /// length, and no more than 63. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this ICapacitiesOperations operations, string resourceGroupName, string dedicatedCapacityName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, dedicatedCapacityName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Updates the current state of the specified Dedicated capacity. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the Azure Resource group of which a given PowerBIDedicated + /// capacity is part. This name must be at least 1 character in length, and no + /// more than 90. + /// + /// + /// The name of the Dedicated capacity. It must be at least 3 characters in + /// length, and no more than 63. + /// + public static DedicatedCapacity Update(this ICapacitiesOperations operations, string resourceGroupName, string dedicatedCapacityName, DedicatedCapacityUpdateParameters capacityUpdateParameters) + { + return ((ICapacitiesOperations)operations).UpdateAsync(resourceGroupName, dedicatedCapacityName, capacityUpdateParameters).GetAwaiter().GetResult(); + } + + /// + /// Updates the current state of the specified Dedicated capacity. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the Azure Resource group of which a given PowerBIDedicated + /// capacity is part. This name must be at least 1 character in length, and no + /// more than 90. + /// + /// + /// The name of the Dedicated capacity. It must be at least 3 characters in + /// length, and no more than 63. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task UpdateAsync(this ICapacitiesOperations operations, string resourceGroupName, string dedicatedCapacityName, DedicatedCapacityUpdateParameters capacityUpdateParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, dedicatedCapacityName, capacityUpdateParameters, null, cancellationToken).ConfigureAwait(false)) { - return operations.CreateAsync(resourceGroupName, dedicatedCapacityName, capacityParameters).GetAwaiter().GetResult(); + return _result.Body; } - - /// - /// Provisions the specified Dedicated capacity based on the configuration - /// specified in the request. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the Azure Resource group of which a given PowerBIDedicated - /// capacity is part. This name must be at least 1 character in length, and no - /// more than 90. - /// - /// - /// The name of the Dedicated capacity. It must be a minimum of 3 characters, - /// and a maximum of 63. - /// - /// - /// Contains the information used to provision the Dedicated capacity. - /// - /// - /// The cancellation token. - /// - public static async Task CreateAsync(this ICapacitiesOperations operations, string resourceGroupName, string dedicatedCapacityName, DedicatedCapacity capacityParameters, CancellationToken cancellationToken = default(CancellationToken)) + } + /// + /// Suspends operation of the specified dedicated capacity instance. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the Azure Resource group of which a given PowerBIDedicated + /// capacity is part. This name must be at least 1 character in length, and no + /// more than 90. + /// + /// + /// The name of the Dedicated capacity. It must be at least 3 characters in + /// length, and no more than 63. + /// + public static void Suspend(this ICapacitiesOperations operations, string resourceGroupName, string dedicatedCapacityName) + { + ((ICapacitiesOperations)operations).SuspendAsync(resourceGroupName, dedicatedCapacityName).GetAwaiter().GetResult(); + } + + /// + /// Suspends operation of the specified dedicated capacity instance. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the Azure Resource group of which a given PowerBIDedicated + /// capacity is part. This name must be at least 1 character in length, and no + /// more than 90. + /// + /// + /// The name of the Dedicated capacity. It must be at least 3 characters in + /// length, and no more than 63. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task SuspendAsync(this ICapacitiesOperations operations, string resourceGroupName, string dedicatedCapacityName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.SuspendWithHttpMessagesAsync(resourceGroupName, dedicatedCapacityName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Resumes operation of the specified Dedicated capacity instance. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the Azure Resource group of which a given PowerBIDedicated + /// capacity is part. This name must be at least 1 character in length, and no + /// more than 90. + /// + /// + /// The name of the Dedicated capacity. It must be at least 3 characters in + /// length, and no more than 63. + /// + public static void Resume(this ICapacitiesOperations operations, string resourceGroupName, string dedicatedCapacityName) + { + ((ICapacitiesOperations)operations).ResumeAsync(resourceGroupName, dedicatedCapacityName).GetAwaiter().GetResult(); + } + + /// + /// Resumes operation of the specified Dedicated capacity instance. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the Azure Resource group of which a given PowerBIDedicated + /// capacity is part. This name must be at least 1 character in length, and no + /// more than 90. + /// + /// + /// The name of the Dedicated capacity. It must be at least 3 characters in + /// length, and no more than 63. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task ResumeAsync(this ICapacitiesOperations operations, string resourceGroupName, string dedicatedCapacityName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.ResumeWithHttpMessagesAsync(resourceGroupName, dedicatedCapacityName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Gets all the Dedicated capacities for the given resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the Azure Resource group of which a given PowerBIDedicated + /// capacity is part. This name must be at least 1 character in length, and no + /// more than 90. + /// + public static System.Collections.Generic.IEnumerable ListByResourceGroup(this ICapacitiesOperations operations, string resourceGroupName) + { + return ((ICapacitiesOperations)operations).ListByResourceGroupAsync(resourceGroupName).GetAwaiter().GetResult(); + } + + /// + /// Gets all the Dedicated capacities for the given resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the Azure Resource group of which a given PowerBIDedicated + /// capacity is part. This name must be at least 1 character in length, and no + /// more than 90. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListByResourceGroupAsync(this ICapacitiesOperations operations, string resourceGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListByResourceGroupWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.CreateWithHttpMessagesAsync(resourceGroupName, dedicatedCapacityName, capacityParameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } - - /// - /// Deletes the specified Dedicated capacity. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the Azure Resource group of which a given PowerBIDedicated - /// capacity is part. This name must be at least 1 character in length, and no - /// more than 90. - /// - /// - /// The name of the Dedicated capacity. It must be at least 3 characters in - /// length, and no more than 63. - /// - public static void Delete(this ICapacitiesOperations operations, string resourceGroupName, string dedicatedCapacityName) + } + /// + /// Lists all the Dedicated capacities for the given subscription. + /// + /// + /// The operations group for this extension method. + /// + public static System.Collections.Generic.IEnumerable List(this ICapacitiesOperations operations) + { + return ((ICapacitiesOperations)operations).ListAsync().GetAwaiter().GetResult(); + } + + /// + /// Lists all the Dedicated capacities for the given subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this ICapacitiesOperations operations, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) { - operations.DeleteAsync(resourceGroupName, dedicatedCapacityName).GetAwaiter().GetResult(); + return _result.Body; } - - /// - /// Deletes the specified Dedicated capacity. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the Azure Resource group of which a given PowerBIDedicated - /// capacity is part. This name must be at least 1 character in length, and no - /// more than 90. - /// - /// - /// The name of the Dedicated capacity. It must be at least 3 characters in - /// length, and no more than 63. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this ICapacitiesOperations operations, string resourceGroupName, string dedicatedCapacityName, CancellationToken cancellationToken = default(CancellationToken)) + } + /// + /// Lists eligible SKUs for PowerBI Dedicated resource provider. + /// + /// + /// The operations group for this extension method. + /// + public static SkuEnumerationForNewResourceResult ListSkus(this ICapacitiesOperations operations) + { + return ((ICapacitiesOperations)operations).ListSkusAsync().GetAwaiter().GetResult(); + } + + /// + /// Lists eligible SKUs for PowerBI Dedicated resource provider. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task ListSkusAsync(this ICapacitiesOperations operations, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListSkusWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, dedicatedCapacityName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + return _result.Body; } - - /// - /// Updates the current state of the specified Dedicated capacity. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the Azure Resource group of which a given PowerBIDedicated - /// capacity is part. This name must be at least 1 character in length, and no - /// more than 90. - /// - /// - /// The name of the Dedicated capacity. It must be at least 3 characters in - /// length, and no more than 63. - /// - /// - /// Request object that contains the updated information for the capacity. - /// - public static DedicatedCapacity Update(this ICapacitiesOperations operations, string resourceGroupName, string dedicatedCapacityName, DedicatedCapacityUpdateParameters capacityUpdateParameters) + } + /// + /// Lists eligible SKUs for a PowerBI Dedicated resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the Azure Resource group of which a given PowerBIDedicated + /// capacity is part. This name must be at least 1 character in length, and no + /// more than 90. + /// + /// + /// The name of the Dedicated capacity. It must be at least 3 characters in + /// length, and no more than 63. + /// + public static SkuEnumerationForExistingResourceResult ListSkusForCapacity(this ICapacitiesOperations operations, string resourceGroupName, string dedicatedCapacityName) + { + return ((ICapacitiesOperations)operations).ListSkusForCapacityAsync(resourceGroupName, dedicatedCapacityName).GetAwaiter().GetResult(); + } + + /// + /// Lists eligible SKUs for a PowerBI Dedicated resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the Azure Resource group of which a given PowerBIDedicated + /// capacity is part. This name must be at least 1 character in length, and no + /// more than 90. + /// + /// + /// The name of the Dedicated capacity. It must be at least 3 characters in + /// length, and no more than 63. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task ListSkusForCapacityAsync(this ICapacitiesOperations operations, string resourceGroupName, string dedicatedCapacityName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListSkusForCapacityWithHttpMessagesAsync(resourceGroupName, dedicatedCapacityName, null, cancellationToken).ConfigureAwait(false)) { - return operations.UpdateAsync(resourceGroupName, dedicatedCapacityName, capacityUpdateParameters).GetAwaiter().GetResult(); + return _result.Body; } - - /// - /// Updates the current state of the specified Dedicated capacity. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the Azure Resource group of which a given PowerBIDedicated - /// capacity is part. This name must be at least 1 character in length, and no - /// more than 90. - /// - /// - /// The name of the Dedicated capacity. It must be at least 3 characters in - /// length, and no more than 63. - /// - /// - /// Request object that contains the updated information for the capacity. - /// - /// - /// The cancellation token. - /// - public static async Task UpdateAsync(this ICapacitiesOperations operations, string resourceGroupName, string dedicatedCapacityName, DedicatedCapacityUpdateParameters capacityUpdateParameters, CancellationToken cancellationToken = default(CancellationToken)) + } + /// + /// Provisions the specified Dedicated capacity based on the configuration + /// specified in the request. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the Azure Resource group of which a given PowerBIDedicated + /// capacity is part. This name must be at least 1 character in length, and no + /// more than 90. + /// + /// + /// The name of the Dedicated capacity. It must be a minimum of 3 characters, + /// and a maximum of 63. + /// + public static DedicatedCapacity BeginCreate(this ICapacitiesOperations operations, string resourceGroupName, string dedicatedCapacityName, DedicatedCapacity capacityParameters) + { + return ((ICapacitiesOperations)operations).BeginCreateAsync(resourceGroupName, dedicatedCapacityName, capacityParameters).GetAwaiter().GetResult(); + } + + /// + /// Provisions the specified Dedicated capacity based on the configuration + /// specified in the request. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the Azure Resource group of which a given PowerBIDedicated + /// capacity is part. This name must be at least 1 character in length, and no + /// more than 90. + /// + /// + /// The name of the Dedicated capacity. It must be a minimum of 3 characters, + /// and a maximum of 63. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginCreateAsync(this ICapacitiesOperations operations, string resourceGroupName, string dedicatedCapacityName, DedicatedCapacity capacityParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginCreateWithHttpMessagesAsync(resourceGroupName, dedicatedCapacityName, capacityParameters, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, dedicatedCapacityName, capacityUpdateParameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } - - /// - /// Suspends operation of the specified dedicated capacity instance. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the Azure Resource group of which a given PowerBIDedicated - /// capacity is part. This name must be at least 1 character in length, and no - /// more than 90. - /// - /// - /// The name of the Dedicated capacity. It must be at least 3 characters in - /// length, and no more than 63. - /// - public static void Suspend(this ICapacitiesOperations operations, string resourceGroupName, string dedicatedCapacityName) + } + /// + /// Deletes the specified Dedicated capacity. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the Azure Resource group of which a given PowerBIDedicated + /// capacity is part. This name must be at least 1 character in length, and no + /// more than 90. + /// + /// + /// The name of the Dedicated capacity. It must be at least 3 characters in + /// length, and no more than 63. + /// + public static void BeginDelete(this ICapacitiesOperations operations, string resourceGroupName, string dedicatedCapacityName) + { + ((ICapacitiesOperations)operations).BeginDeleteAsync(resourceGroupName, dedicatedCapacityName).GetAwaiter().GetResult(); + } + + /// + /// Deletes the specified Dedicated capacity. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the Azure Resource group of which a given PowerBIDedicated + /// capacity is part. This name must be at least 1 character in length, and no + /// more than 90. + /// + /// + /// The name of the Dedicated capacity. It must be at least 3 characters in + /// length, and no more than 63. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginDeleteAsync(this ICapacitiesOperations operations, string resourceGroupName, string dedicatedCapacityName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, dedicatedCapacityName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Updates the current state of the specified Dedicated capacity. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the Azure Resource group of which a given PowerBIDedicated + /// capacity is part. This name must be at least 1 character in length, and no + /// more than 90. + /// + /// + /// The name of the Dedicated capacity. It must be at least 3 characters in + /// length, and no more than 63. + /// + public static DedicatedCapacity BeginUpdate(this ICapacitiesOperations operations, string resourceGroupName, string dedicatedCapacityName, DedicatedCapacityUpdateParameters capacityUpdateParameters) + { + return ((ICapacitiesOperations)operations).BeginUpdateAsync(resourceGroupName, dedicatedCapacityName, capacityUpdateParameters).GetAwaiter().GetResult(); + } + + /// + /// Updates the current state of the specified Dedicated capacity. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the Azure Resource group of which a given PowerBIDedicated + /// capacity is part. This name must be at least 1 character in length, and no + /// more than 90. + /// + /// + /// The name of the Dedicated capacity. It must be at least 3 characters in + /// length, and no more than 63. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginUpdateAsync(this ICapacitiesOperations operations, string resourceGroupName, string dedicatedCapacityName, DedicatedCapacityUpdateParameters capacityUpdateParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginUpdateWithHttpMessagesAsync(resourceGroupName, dedicatedCapacityName, capacityUpdateParameters, null, cancellationToken).ConfigureAwait(false)) { - operations.SuspendAsync(resourceGroupName, dedicatedCapacityName).GetAwaiter().GetResult(); + return _result.Body; } - - /// - /// Suspends operation of the specified dedicated capacity instance. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the Azure Resource group of which a given PowerBIDedicated - /// capacity is part. This name must be at least 1 character in length, and no - /// more than 90. - /// - /// - /// The name of the Dedicated capacity. It must be at least 3 characters in - /// length, and no more than 63. - /// - /// - /// The cancellation token. - /// - public static async Task SuspendAsync(this ICapacitiesOperations operations, string resourceGroupName, string dedicatedCapacityName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.SuspendWithHttpMessagesAsync(resourceGroupName, dedicatedCapacityName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Resumes operation of the specified Dedicated capacity instance. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the Azure Resource group of which a given PowerBIDedicated - /// capacity is part. This name must be at least 1 character in length, and no - /// more than 90. - /// - /// - /// The name of the Dedicated capacity. It must be at least 3 characters in - /// length, and no more than 63. - /// - public static void Resume(this ICapacitiesOperations operations, string resourceGroupName, string dedicatedCapacityName) - { - operations.ResumeAsync(resourceGroupName, dedicatedCapacityName).GetAwaiter().GetResult(); - } - - /// - /// Resumes operation of the specified Dedicated capacity instance. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the Azure Resource group of which a given PowerBIDedicated - /// capacity is part. This name must be at least 1 character in length, and no - /// more than 90. - /// - /// - /// The name of the Dedicated capacity. It must be at least 3 characters in - /// length, and no more than 63. - /// - /// - /// The cancellation token. - /// - public static async Task ResumeAsync(this ICapacitiesOperations operations, string resourceGroupName, string dedicatedCapacityName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.ResumeWithHttpMessagesAsync(resourceGroupName, dedicatedCapacityName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Gets all the Dedicated capacities for the given resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the Azure Resource group of which a given PowerBIDedicated - /// capacity is part. This name must be at least 1 character in length, and no - /// more than 90. - /// - public static IEnumerable ListByResourceGroup(this ICapacitiesOperations operations, string resourceGroupName) - { - return operations.ListByResourceGroupAsync(resourceGroupName).GetAwaiter().GetResult(); - } - - /// - /// Gets all the Dedicated capacities for the given resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the Azure Resource group of which a given PowerBIDedicated - /// capacity is part. This name must be at least 1 character in length, and no - /// more than 90. - /// - /// - /// The cancellation token. - /// - public static async Task> ListByResourceGroupAsync(this ICapacitiesOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListByResourceGroupWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Lists all the Dedicated capacities for the given subscription. - /// - /// - /// The operations group for this extension method. - /// - public static IEnumerable List(this ICapacitiesOperations operations) - { - return operations.ListAsync().GetAwaiter().GetResult(); - } - - /// - /// Lists all the Dedicated capacities for the given subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this ICapacitiesOperations operations, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Lists eligible SKUs for PowerBI Dedicated resource provider. - /// - /// - /// The operations group for this extension method. - /// - public static SkuEnumerationForNewResourceResult ListSkus(this ICapacitiesOperations operations) - { - return operations.ListSkusAsync().GetAwaiter().GetResult(); - } - - /// - /// Lists eligible SKUs for PowerBI Dedicated resource provider. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The cancellation token. - /// - public static async Task ListSkusAsync(this ICapacitiesOperations operations, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListSkusWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Lists eligible SKUs for a PowerBI Dedicated resource. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the Azure Resource group of which a given PowerBIDedicated - /// capacity is part. This name must be at least 1 character in length, and no - /// more than 90. - /// - /// - /// The name of the Dedicated capacity. It must be at least 3 characters in - /// length, and no more than 63. - /// - public static SkuEnumerationForExistingResourceResult ListSkusForCapacity(this ICapacitiesOperations operations, string resourceGroupName, string dedicatedCapacityName) - { - return operations.ListSkusForCapacityAsync(resourceGroupName, dedicatedCapacityName).GetAwaiter().GetResult(); - } - - /// - /// Lists eligible SKUs for a PowerBI Dedicated resource. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the Azure Resource group of which a given PowerBIDedicated - /// capacity is part. This name must be at least 1 character in length, and no - /// more than 90. - /// - /// - /// The name of the Dedicated capacity. It must be at least 3 characters in - /// length, and no more than 63. - /// - /// - /// The cancellation token. - /// - public static async Task ListSkusForCapacityAsync(this ICapacitiesOperations operations, string resourceGroupName, string dedicatedCapacityName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListSkusForCapacityWithHttpMessagesAsync(resourceGroupName, dedicatedCapacityName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Provisions the specified Dedicated capacity based on the configuration - /// specified in the request. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the Azure Resource group of which a given PowerBIDedicated - /// capacity is part. This name must be at least 1 character in length, and no - /// more than 90. - /// - /// - /// The name of the Dedicated capacity. It must be a minimum of 3 characters, - /// and a maximum of 63. - /// - /// - /// Contains the information used to provision the Dedicated capacity. - /// - public static DedicatedCapacity BeginCreate(this ICapacitiesOperations operations, string resourceGroupName, string dedicatedCapacityName, DedicatedCapacity capacityParameters) - { - return operations.BeginCreateAsync(resourceGroupName, dedicatedCapacityName, capacityParameters).GetAwaiter().GetResult(); - } - - /// - /// Provisions the specified Dedicated capacity based on the configuration - /// specified in the request. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the Azure Resource group of which a given PowerBIDedicated - /// capacity is part. This name must be at least 1 character in length, and no - /// more than 90. - /// - /// - /// The name of the Dedicated capacity. It must be a minimum of 3 characters, - /// and a maximum of 63. - /// - /// - /// Contains the information used to provision the Dedicated capacity. - /// - /// - /// The cancellation token. - /// - public static async Task BeginCreateAsync(this ICapacitiesOperations operations, string resourceGroupName, string dedicatedCapacityName, DedicatedCapacity capacityParameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginCreateWithHttpMessagesAsync(resourceGroupName, dedicatedCapacityName, capacityParameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Deletes the specified Dedicated capacity. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the Azure Resource group of which a given PowerBIDedicated - /// capacity is part. This name must be at least 1 character in length, and no - /// more than 90. - /// - /// - /// The name of the Dedicated capacity. It must be at least 3 characters in - /// length, and no more than 63. - /// - public static void BeginDelete(this ICapacitiesOperations operations, string resourceGroupName, string dedicatedCapacityName) - { - operations.BeginDeleteAsync(resourceGroupName, dedicatedCapacityName).GetAwaiter().GetResult(); - } - - /// - /// Deletes the specified Dedicated capacity. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the Azure Resource group of which a given PowerBIDedicated - /// capacity is part. This name must be at least 1 character in length, and no - /// more than 90. - /// - /// - /// The name of the Dedicated capacity. It must be at least 3 characters in - /// length, and no more than 63. - /// - /// - /// The cancellation token. - /// - public static async Task BeginDeleteAsync(this ICapacitiesOperations operations, string resourceGroupName, string dedicatedCapacityName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, dedicatedCapacityName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Updates the current state of the specified Dedicated capacity. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the Azure Resource group of which a given PowerBIDedicated - /// capacity is part. This name must be at least 1 character in length, and no - /// more than 90. - /// - /// - /// The name of the Dedicated capacity. It must be at least 3 characters in - /// length, and no more than 63. - /// - /// - /// Request object that contains the updated information for the capacity. - /// - public static DedicatedCapacity BeginUpdate(this ICapacitiesOperations operations, string resourceGroupName, string dedicatedCapacityName, DedicatedCapacityUpdateParameters capacityUpdateParameters) - { - return operations.BeginUpdateAsync(resourceGroupName, dedicatedCapacityName, capacityUpdateParameters).GetAwaiter().GetResult(); - } - - /// - /// Updates the current state of the specified Dedicated capacity. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the Azure Resource group of which a given PowerBIDedicated - /// capacity is part. This name must be at least 1 character in length, and no - /// more than 90. - /// - /// - /// The name of the Dedicated capacity. It must be at least 3 characters in - /// length, and no more than 63. - /// - /// - /// Request object that contains the updated information for the capacity. - /// - /// - /// The cancellation token. - /// - public static async Task BeginUpdateAsync(this ICapacitiesOperations operations, string resourceGroupName, string dedicatedCapacityName, DedicatedCapacityUpdateParameters capacityUpdateParameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginUpdateWithHttpMessagesAsync(resourceGroupName, dedicatedCapacityName, capacityUpdateParameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Suspends operation of the specified dedicated capacity instance. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the Azure Resource group of which a given PowerBIDedicated - /// capacity is part. This name must be at least 1 character in length, and no - /// more than 90. - /// - /// - /// The name of the Dedicated capacity. It must be at least 3 characters in - /// length, and no more than 63. - /// - public static void BeginSuspend(this ICapacitiesOperations operations, string resourceGroupName, string dedicatedCapacityName) - { - operations.BeginSuspendAsync(resourceGroupName, dedicatedCapacityName).GetAwaiter().GetResult(); - } - - /// - /// Suspends operation of the specified dedicated capacity instance. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the Azure Resource group of which a given PowerBIDedicated - /// capacity is part. This name must be at least 1 character in length, and no - /// more than 90. - /// - /// - /// The name of the Dedicated capacity. It must be at least 3 characters in - /// length, and no more than 63. - /// - /// - /// The cancellation token. - /// - public static async Task BeginSuspendAsync(this ICapacitiesOperations operations, string resourceGroupName, string dedicatedCapacityName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginSuspendWithHttpMessagesAsync(resourceGroupName, dedicatedCapacityName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Resumes operation of the specified Dedicated capacity instance. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the Azure Resource group of which a given PowerBIDedicated - /// capacity is part. This name must be at least 1 character in length, and no - /// more than 90. - /// - /// - /// The name of the Dedicated capacity. It must be at least 3 characters in - /// length, and no more than 63. - /// - public static void BeginResume(this ICapacitiesOperations operations, string resourceGroupName, string dedicatedCapacityName) - { - operations.BeginResumeAsync(resourceGroupName, dedicatedCapacityName).GetAwaiter().GetResult(); - } - - /// - /// Resumes operation of the specified Dedicated capacity instance. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the Azure Resource group of which a given PowerBIDedicated - /// capacity is part. This name must be at least 1 character in length, and no - /// more than 90. - /// - /// - /// The name of the Dedicated capacity. It must be at least 3 characters in - /// length, and no more than 63. - /// - /// - /// The cancellation token. - /// - public static async Task BeginResumeAsync(this ICapacitiesOperations operations, string resourceGroupName, string dedicatedCapacityName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginResumeWithHttpMessagesAsync(resourceGroupName, dedicatedCapacityName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - + } + /// + /// Suspends operation of the specified dedicated capacity instance. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the Azure Resource group of which a given PowerBIDedicated + /// capacity is part. This name must be at least 1 character in length, and no + /// more than 90. + /// + /// + /// The name of the Dedicated capacity. It must be at least 3 characters in + /// length, and no more than 63. + /// + public static void BeginSuspend(this ICapacitiesOperations operations, string resourceGroupName, string dedicatedCapacityName) + { + ((ICapacitiesOperations)operations).BeginSuspendAsync(resourceGroupName, dedicatedCapacityName).GetAwaiter().GetResult(); + } + + /// + /// Suspends operation of the specified dedicated capacity instance. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the Azure Resource group of which a given PowerBIDedicated + /// capacity is part. This name must be at least 1 character in length, and no + /// more than 90. + /// + /// + /// The name of the Dedicated capacity. It must be at least 3 characters in + /// length, and no more than 63. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginSuspendAsync(this ICapacitiesOperations operations, string resourceGroupName, string dedicatedCapacityName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginSuspendWithHttpMessagesAsync(resourceGroupName, dedicatedCapacityName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Resumes operation of the specified Dedicated capacity instance. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the Azure Resource group of which a given PowerBIDedicated + /// capacity is part. This name must be at least 1 character in length, and no + /// more than 90. + /// + /// + /// The name of the Dedicated capacity. It must be at least 3 characters in + /// length, and no more than 63. + /// + public static void BeginResume(this ICapacitiesOperations operations, string resourceGroupName, string dedicatedCapacityName) + { + ((ICapacitiesOperations)operations).BeginResumeAsync(resourceGroupName, dedicatedCapacityName).GetAwaiter().GetResult(); + } + + /// + /// Resumes operation of the specified Dedicated capacity instance. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the Azure Resource group of which a given PowerBIDedicated + /// capacity is part. This name must be at least 1 character in length, and no + /// more than 90. + /// + /// + /// The name of the Dedicated capacity. It must be at least 3 characters in + /// length, and no more than 63. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginResumeAsync(this ICapacitiesOperations operations, string resourceGroupName, string dedicatedCapacityName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginResumeWithHttpMessagesAsync(resourceGroupName, dedicatedCapacityName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } } } diff --git a/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/ICapacitiesOperations.cs b/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/ICapacitiesOperations.cs index 985174e0c941..704334d7c4ee 100644 --- a/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/ICapacitiesOperations.cs +++ b/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/ICapacitiesOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.PowerBIDedicated { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// CapacitiesOperations operations. @@ -26,14 +16,17 @@ public partial interface ICapacitiesOperations /// /// Gets details about the specified dedicated capacity. /// + /// + /// Gets details about the specified dedicated capacity. + /// /// - /// The name of the Azure Resource group of which a given - /// PowerBIDedicated capacity is part. This name must be at least 1 - /// character in length, and no more than 90. + /// The name of the Azure Resource group of which a given PowerBIDedicated + /// capacity is part. This name must be at least 1 character in length, and no + /// more than 90. /// /// - /// The name of the dedicated capacity. It must be a minimum of 3 - /// characters, and a maximum of 63. + /// The name of the dedicated capacity. It must be a minimum of 3 characters, + /// and a maximum of 63. /// /// /// The headers that will be added to request. @@ -47,22 +40,24 @@ public partial interface ICapacitiesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetDetailsWithHttpMessagesAsync(string resourceGroupName, string dedicatedCapacityName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetDetailsWithHttpMessagesAsync(string resourceGroupName, string dedicatedCapacityName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Provisions the specified Dedicated capacity based on the - /// configuration specified in the request. + /// Provisions the specified Dedicated capacity based on the configuration + /// specified in the request. /// + /// + /// Provisions the specified Dedicated capacity based on the configuration + /// specified in the request. + /// /// - /// The name of the Azure Resource group of which a given - /// PowerBIDedicated capacity is part. This name must be at least 1 - /// character in length, and no more than 90. + /// The name of the Azure Resource group of which a given PowerBIDedicated + /// capacity is part. This name must be at least 1 character in length, and no + /// more than 90. /// /// - /// The name of the Dedicated capacity. It must be a minimum of 3 - /// characters, and a maximum of 63. + /// The name of the Dedicated capacity. It must be a minimum of 3 characters, + /// and a maximum of 63. /// /// /// Contains the information used to provision the Dedicated capacity. @@ -79,21 +74,22 @@ public partial interface ICapacitiesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateWithHttpMessagesAsync(string resourceGroupName, string dedicatedCapacityName, DedicatedCapacity capacityParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CreateWithHttpMessagesAsync(string resourceGroupName, string dedicatedCapacityName, DedicatedCapacity capacityParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Deletes the specified Dedicated capacity. /// + /// + /// Deletes the specified Dedicated capacity. + /// /// - /// The name of the Azure Resource group of which a given - /// PowerBIDedicated capacity is part. This name must be at least 1 - /// character in length, and no more than 90. + /// The name of the Azure Resource group of which a given PowerBIDedicated + /// capacity is part. This name must be at least 1 character in length, and no + /// more than 90. /// /// - /// The name of the Dedicated capacity. It must be at least 3 - /// characters in length, and no more than 63. + /// The name of the Dedicated capacity. It must be at least 3 characters in + /// length, and no more than 63. /// /// /// The headers that will be added to request. @@ -104,25 +100,25 @@ public partial interface ICapacitiesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string dedicatedCapacityName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string dedicatedCapacityName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Updates the current state of the specified Dedicated capacity. /// + /// + /// Updates the current state of the specified Dedicated capacity. + /// /// - /// The name of the Azure Resource group of which a given - /// PowerBIDedicated capacity is part. This name must be at least 1 - /// character in length, and no more than 90. + /// The name of the Azure Resource group of which a given PowerBIDedicated + /// capacity is part. This name must be at least 1 character in length, and no + /// more than 90. /// /// - /// The name of the Dedicated capacity. It must be at least 3 - /// characters in length, and no more than 63. + /// The name of the Dedicated capacity. It must be at least 3 characters in + /// length, and no more than 63. /// /// - /// Request object that contains the updated information for the - /// capacity. + /// Request object that contains the updated information for the capacity. /// /// /// The headers that will be added to request. @@ -136,21 +132,22 @@ public partial interface ICapacitiesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string dedicatedCapacityName, DedicatedCapacityUpdateParameters capacityUpdateParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string dedicatedCapacityName, DedicatedCapacityUpdateParameters capacityUpdateParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Suspends operation of the specified dedicated capacity instance. /// + /// + /// Suspends operation of the specified dedicated capacity instance. + /// /// - /// The name of the Azure Resource group of which a given - /// PowerBIDedicated capacity is part. This name must be at least 1 - /// character in length, and no more than 90. + /// The name of the Azure Resource group of which a given PowerBIDedicated + /// capacity is part. This name must be at least 1 character in length, and no + /// more than 90. /// /// - /// The name of the Dedicated capacity. It must be at least 3 - /// characters in length, and no more than 63. + /// The name of the Dedicated capacity. It must be at least 3 characters in + /// length, and no more than 63. /// /// /// The headers that will be added to request. @@ -161,21 +158,22 @@ public partial interface ICapacitiesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task SuspendWithHttpMessagesAsync(string resourceGroupName, string dedicatedCapacityName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task SuspendWithHttpMessagesAsync(string resourceGroupName, string dedicatedCapacityName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Resumes operation of the specified Dedicated capacity instance. /// + /// + /// Resumes operation of the specified Dedicated capacity instance. + /// /// - /// The name of the Azure Resource group of which a given - /// PowerBIDedicated capacity is part. This name must be at least 1 - /// character in length, and no more than 90. + /// The name of the Azure Resource group of which a given PowerBIDedicated + /// capacity is part. This name must be at least 1 character in length, and no + /// more than 90. /// /// - /// The name of the Dedicated capacity. It must be at least 3 - /// characters in length, and no more than 63. + /// The name of the Dedicated capacity. It must be at least 3 characters in + /// length, and no more than 63. /// /// /// The headers that will be added to request. @@ -186,17 +184,18 @@ public partial interface ICapacitiesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task ResumeWithHttpMessagesAsync(string resourceGroupName, string dedicatedCapacityName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task ResumeWithHttpMessagesAsync(string resourceGroupName, string dedicatedCapacityName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets all the Dedicated capacities for the given resource group. /// + /// + /// Gets all the Dedicated capacities for the given resource group. + /// /// - /// The name of the Azure Resource group of which a given - /// PowerBIDedicated capacity is part. This name must be at least 1 - /// character in length, and no more than 90. + /// The name of the Azure Resource group of which a given PowerBIDedicated + /// capacity is part. This name must be at least 1 character in length, and no + /// more than 90. /// /// /// The headers that will be added to request. @@ -210,13 +209,14 @@ public partial interface ICapacitiesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Lists all the Dedicated capacities for the given subscription. /// + /// + /// Lists all the Dedicated capacities for the given subscription. + /// /// /// The headers that will be added to request. /// @@ -229,13 +229,14 @@ public partial interface ICapacitiesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Lists eligible SKUs for PowerBI Dedicated resource provider. /// + /// + /// Lists eligible SKUs for PowerBI Dedicated resource provider. + /// /// /// The headers that will be added to request. /// @@ -248,21 +249,22 @@ public partial interface ICapacitiesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> ListSkusWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> ListSkusWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Lists eligible SKUs for a PowerBI Dedicated resource. /// + /// + /// Lists eligible SKUs for a PowerBI Dedicated resource. + /// /// - /// The name of the Azure Resource group of which a given - /// PowerBIDedicated capacity is part. This name must be at least 1 - /// character in length, and no more than 90. + /// The name of the Azure Resource group of which a given PowerBIDedicated + /// capacity is part. This name must be at least 1 character in length, and no + /// more than 90. /// /// - /// The name of the Dedicated capacity. It must be at least 3 - /// characters in length, and no more than 63. + /// The name of the Dedicated capacity. It must be at least 3 characters in + /// length, and no more than 63. /// /// /// The headers that will be added to request. @@ -276,22 +278,24 @@ public partial interface ICapacitiesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> ListSkusForCapacityWithHttpMessagesAsync(string resourceGroupName, string dedicatedCapacityName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> ListSkusForCapacityWithHttpMessagesAsync(string resourceGroupName, string dedicatedCapacityName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Provisions the specified Dedicated capacity based on the - /// configuration specified in the request. + /// Provisions the specified Dedicated capacity based on the configuration + /// specified in the request. /// + /// + /// Provisions the specified Dedicated capacity based on the configuration + /// specified in the request. + /// /// - /// The name of the Azure Resource group of which a given - /// PowerBIDedicated capacity is part. This name must be at least 1 - /// character in length, and no more than 90. + /// The name of the Azure Resource group of which a given PowerBIDedicated + /// capacity is part. This name must be at least 1 character in length, and no + /// more than 90. /// /// - /// The name of the Dedicated capacity. It must be a minimum of 3 - /// characters, and a maximum of 63. + /// The name of the Dedicated capacity. It must be a minimum of 3 characters, + /// and a maximum of 63. /// /// /// Contains the information used to provision the Dedicated capacity. @@ -308,21 +312,22 @@ public partial interface ICapacitiesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginCreateWithHttpMessagesAsync(string resourceGroupName, string dedicatedCapacityName, DedicatedCapacity capacityParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginCreateWithHttpMessagesAsync(string resourceGroupName, string dedicatedCapacityName, DedicatedCapacity capacityParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Deletes the specified Dedicated capacity. /// + /// + /// Deletes the specified Dedicated capacity. + /// /// - /// The name of the Azure Resource group of which a given - /// PowerBIDedicated capacity is part. This name must be at least 1 - /// character in length, and no more than 90. + /// The name of the Azure Resource group of which a given PowerBIDedicated + /// capacity is part. This name must be at least 1 character in length, and no + /// more than 90. /// /// - /// The name of the Dedicated capacity. It must be at least 3 - /// characters in length, and no more than 63. + /// The name of the Dedicated capacity. It must be at least 3 characters in + /// length, and no more than 63. /// /// /// The headers that will be added to request. @@ -333,25 +338,25 @@ public partial interface ICapacitiesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string dedicatedCapacityName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string dedicatedCapacityName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Updates the current state of the specified Dedicated capacity. /// + /// + /// Updates the current state of the specified Dedicated capacity. + /// /// - /// The name of the Azure Resource group of which a given - /// PowerBIDedicated capacity is part. This name must be at least 1 - /// character in length, and no more than 90. + /// The name of the Azure Resource group of which a given PowerBIDedicated + /// capacity is part. This name must be at least 1 character in length, and no + /// more than 90. /// /// - /// The name of the Dedicated capacity. It must be at least 3 - /// characters in length, and no more than 63. + /// The name of the Dedicated capacity. It must be at least 3 characters in + /// length, and no more than 63. /// /// - /// Request object that contains the updated information for the - /// capacity. + /// Request object that contains the updated information for the capacity. /// /// /// The headers that will be added to request. @@ -365,21 +370,22 @@ public partial interface ICapacitiesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string dedicatedCapacityName, DedicatedCapacityUpdateParameters capacityUpdateParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string dedicatedCapacityName, DedicatedCapacityUpdateParameters capacityUpdateParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Suspends operation of the specified dedicated capacity instance. /// + /// + /// Suspends operation of the specified dedicated capacity instance. + /// /// - /// The name of the Azure Resource group of which a given - /// PowerBIDedicated capacity is part. This name must be at least 1 - /// character in length, and no more than 90. + /// The name of the Azure Resource group of which a given PowerBIDedicated + /// capacity is part. This name must be at least 1 character in length, and no + /// more than 90. /// /// - /// The name of the Dedicated capacity. It must be at least 3 - /// characters in length, and no more than 63. + /// The name of the Dedicated capacity. It must be at least 3 characters in + /// length, and no more than 63. /// /// /// The headers that will be added to request. @@ -390,21 +396,22 @@ public partial interface ICapacitiesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginSuspendWithHttpMessagesAsync(string resourceGroupName, string dedicatedCapacityName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginSuspendWithHttpMessagesAsync(string resourceGroupName, string dedicatedCapacityName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Resumes operation of the specified Dedicated capacity instance. /// + /// + /// Resumes operation of the specified Dedicated capacity instance. + /// /// - /// The name of the Azure Resource group of which a given - /// PowerBIDedicated capacity is part. This name must be at least 1 - /// character in length, and no more than 90. + /// The name of the Azure Resource group of which a given PowerBIDedicated + /// capacity is part. This name must be at least 1 character in length, and no + /// more than 90. /// /// - /// The name of the Dedicated capacity. It must be at least 3 - /// characters in length, and no more than 63. + /// The name of the Dedicated capacity. It must be at least 3 characters in + /// length, and no more than 63. /// /// /// The headers that will be added to request. @@ -415,9 +422,7 @@ public partial interface ICapacitiesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginResumeWithHttpMessagesAsync(string resourceGroupName, string dedicatedCapacityName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginResumeWithHttpMessagesAsync(string resourceGroupName, string dedicatedCapacityName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/IOperations.cs b/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/IOperations.cs index ba6a40caea46..2b2de69eab2b 100644 --- a/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/IOperations.cs +++ b/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/IOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.PowerBIDedicated { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// Operations operations. @@ -26,25 +16,29 @@ public partial interface IOperations /// /// Lists all of the available PowerBIDedicated REST API operations. /// + /// + /// Lists all of the available PowerBIDedicated REST API operations. + /// /// /// The headers that will be added to request. /// /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Lists all of the available PowerBIDedicated REST API operations. /// + /// + /// Lists all of the available PowerBIDedicated REST API operations. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -54,15 +48,13 @@ public partial interface IOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/IPowerBIDedicatedManagementClient.cs b/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/IPowerBIDedicatedManagementClient.cs index 46ceca37c946..1ff6e398525d 100644 --- a/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/IPowerBIDedicatedManagementClient.cs +++ b/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/IPowerBIDedicatedManagementClient.cs @@ -1,26 +1,20 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.PowerBIDedicated { using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; /// /// PowerBI Dedicated Web API provides a RESTful set of web services that - /// enables users to create, retrieve, update, and delete Power BI - /// dedicated capacities + /// enables users to create, retrieve, update, and delete Power BI dedicated + /// capacities /// - public partial interface IPowerBIDedicatedManagementClient : System.IDisposable + public partial interface IPowerBIDedicatedManagementClient : System.IDisposable { /// /// The base URI of the service. @@ -30,57 +24,62 @@ public partial interface IPowerBIDedicatedManagementClient : System.IDisposable /// /// Gets or sets json serialization settings. /// - JsonSerializerSettings SerializationSettings { get; } + Newtonsoft.Json.JsonSerializerSettings SerializationSettings { get; } /// /// Gets or sets json deserialization settings. /// - JsonSerializerSettings DeserializationSettings { get; } + Newtonsoft.Json.JsonSerializerSettings DeserializationSettings { get; } /// /// Credentials needed for the client to connect to Azure. /// - ServiceClientCredentials Credentials { get; } + Microsoft.Rest.ServiceClientCredentials Credentials { get;} + /// - /// A unique identifier for a Microsoft Azure subscription. The - /// subscription ID forms part of the URI for every service call. + /// The API version to use for this operation. /// - string SubscriptionId { get; set; } + string ApiVersion { get;} + /// - /// The client API version. + /// A unique identifier for a Microsoft Azure subscription. The subscription ID + /// forms part of the URI for every service call. /// - string ApiVersion { get; } + string SubscriptionId { get; set;} + /// /// The preferred language for the response. /// - string AcceptLanguage { get; set; } + string AcceptLanguage { get; set;} + /// /// The retry timeout in seconds for Long Running Operations. Default - /// value is 30. + /// /// value is 30. /// - int? LongRunningOperationRetryTimeout { get; set; } + int? LongRunningOperationRetryTimeout { get; set;} + /// /// Whether a unique x-ms-client-request-id should be generated. When - /// set to true a unique x-ms-client-request-id value is generated and - /// included in each request. Default is true. + /// /// set to true a unique x-ms-client-request-id value is generated and + /// /// included in each request. Default is true. /// - bool? GenerateClientRequestId { get; set; } + bool? GenerateClientRequestId { get; set;} /// - /// Gets the ICapacitiesOperations. + /// Gets the ICapacitiesOperations /// ICapacitiesOperations Capacities { get; } /// - /// Gets the IOperations. + /// Gets the IOperations /// IOperations Operations { get; } } -} +} \ No newline at end of file diff --git a/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/Models/DedicatedCapacity.cs b/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/Models/DedicatedCapacity.cs index 0fec40850ab1..fb8362d7f029 100644 --- a/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/Models/DedicatedCapacity.cs +++ b/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/Models/DedicatedCapacity.cs @@ -1,26 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.PowerBIDedicated.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// Represents an instance of a Dedicated Capacity resource. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class DedicatedCapacity : Resource { /// @@ -34,37 +24,46 @@ public DedicatedCapacity() /// /// Initializes a new instance of the DedicatedCapacity class. /// - /// Location of the PowerBI Dedicated - /// resource. - /// The SKU of the PowerBI Dedicated - /// resource. - /// An identifier that represents the PowerBI - /// Dedicated resource. - /// The name of the PowerBI Dedicated - /// resource. - /// The type of the PowerBI Dedicated - /// resource. - /// Key-value pairs of additional resource - /// provisioning properties. - /// A collection of Dedicated capacity - /// administrators - /// The current state of PowerBI Dedicated - /// resource. The state is to indicate more states outside of resource - /// provisioning. Possible values include: 'Deleting', 'Succeeded', - /// 'Failed', 'Paused', 'Suspended', 'Provisioning', 'Updating', - /// 'Suspending', 'Pausing', 'Resuming', 'Preparing', 'Scaling' - /// The current deployment state of - /// PowerBI Dedicatedresource. The provisioningState is to indicate - /// states for resource provisioning. Possible values include: - /// 'Deleting', 'Succeeded', 'Failed', 'Paused', 'Suspended', - /// 'Provisioning', 'Updating', 'Suspending', 'Pausing', 'Resuming', - /// 'Preparing', 'Scaling' - public DedicatedCapacity(string location, ResourceSku sku, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), DedicatedCapacityAdministrators administration = default(DedicatedCapacityAdministrators), string state = default(string), string provisioningState = default(string)) - : base(location, sku, id, name, type, tags) + + /// An identifier that represents the PowerBI Dedicated resource. + /// + + /// The name of the PowerBI Dedicated resource. + /// + + /// The type of the PowerBI Dedicated resource. + /// + + /// Location of the PowerBI Dedicated resource. + /// + + /// The SKU of the PowerBI Dedicated resource. + /// + + /// Key-value pairs of additional resource provisioning properties. + /// + + /// The current state of PowerBI Dedicated resource. The state is to indicate + /// more states outside of resource provisioning. + /// Possible values include: 'Deleting', 'Succeeded', 'Failed', 'Paused', + /// 'Suspended', 'Provisioning', 'Updating', 'Suspending', 'Pausing', + /// 'Resuming', 'Preparing', 'Scaling' + + /// The current deployment state of PowerBI Dedicatedresource. The + /// provisioningState is to indicate states for resource provisioning. + /// Possible values include: 'Deleting', 'Succeeded', 'Failed', 'Paused', + /// 'Suspended', 'Provisioning', 'Updating', 'Suspending', 'Pausing', + /// 'Resuming', 'Preparing', 'Scaling' + + /// A collection of Dedicated capacity administrators + /// + public DedicatedCapacity(string location, ResourceSku sku, string id = default(string), string name = default(string), string type = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), string state = default(string), string provisioningState = default(string), DedicatedCapacityAdministrators administration = default(DedicatedCapacityAdministrators)) + + : base(location, sku, id, name, type, tags) { - Administration = administration; - State = state; - ProvisioningState = provisioningState; + this.State = state; + this.ProvisioningState = provisioningState; + this.Administration = administration; CustomInit(); } @@ -73,41 +72,38 @@ public DedicatedCapacity() /// partial void CustomInit(); - /// - /// Gets or sets a collection of Dedicated capacity administrators - /// - [JsonProperty(PropertyName = "properties.administration")] - public DedicatedCapacityAdministrators Administration { get; set; } /// - /// Gets the current state of PowerBI Dedicated resource. The state is - /// to indicate more states outside of resource provisioning. Possible - /// values include: 'Deleting', 'Succeeded', 'Failed', 'Paused', - /// 'Suspended', 'Provisioning', 'Updating', 'Suspending', 'Pausing', - /// 'Resuming', 'Preparing', 'Scaling' + /// Gets the current state of PowerBI Dedicated resource. The state is to + /// indicate more states outside of resource provisioning. Possible values include: 'Deleting', 'Succeeded', 'Failed', 'Paused', 'Suspended', 'Provisioning', 'Updating', 'Suspending', 'Pausing', 'Resuming', 'Preparing', 'Scaling' /// - [JsonProperty(PropertyName = "properties.state")] - public string State { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.state")] + public string State {get; private set; } /// /// Gets the current deployment state of PowerBI Dedicatedresource. The - /// provisioningState is to indicate states for resource provisioning. - /// Possible values include: 'Deleting', 'Succeeded', 'Failed', - /// 'Paused', 'Suspended', 'Provisioning', 'Updating', 'Suspending', - /// 'Pausing', 'Resuming', 'Preparing', 'Scaling' + /// provisioningState is to indicate states for resource provisioning. Possible values include: 'Deleting', 'Succeeded', 'Failed', 'Paused', 'Suspended', 'Provisioning', 'Updating', 'Suspending', 'Pausing', 'Resuming', 'Preparing', 'Scaling' /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } + /// + /// Gets or sets a collection of Dedicated capacity administrators + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.administration")] + public DedicatedCapacityAdministrators Administration {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public override void Validate() { base.Validate(); + + + } } -} +} \ No newline at end of file diff --git a/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/Models/DedicatedCapacityAdministrators.cs b/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/Models/DedicatedCapacityAdministrators.cs index 0bb98597b459..0374dbb25953 100644 --- a/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/Models/DedicatedCapacityAdministrators.cs +++ b/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/Models/DedicatedCapacityAdministrators.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.PowerBIDedicated.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -21,8 +13,7 @@ namespace Microsoft.Azure.Management.PowerBIDedicated.Models public partial class DedicatedCapacityAdministrators { /// - /// Initializes a new instance of the DedicatedCapacityAdministrators - /// class. + /// Initializes a new instance of the DedicatedCapacityAdministrators class. /// public DedicatedCapacityAdministrators() { @@ -30,14 +21,15 @@ public DedicatedCapacityAdministrators() } /// - /// Initializes a new instance of the DedicatedCapacityAdministrators - /// class. + /// Initializes a new instance of the DedicatedCapacityAdministrators class. /// - /// An array of administrator user - /// identities. - public DedicatedCapacityAdministrators(IList members = default(IList)) + + /// An array of administrator user identities. + /// + public DedicatedCapacityAdministrators(System.Collections.Generic.IList members = default(System.Collections.Generic.IList)) + { - Members = members; + this.Members = members; CustomInit(); } @@ -46,11 +38,11 @@ public DedicatedCapacityAdministrators() /// partial void CustomInit(); + /// /// Gets or sets an array of administrator user identities. /// - [JsonProperty(PropertyName = "members")] - public IList Members { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "members")] + public System.Collections.Generic.IList Members {get; set; } } -} +} \ No newline at end of file diff --git a/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/Models/DedicatedCapacityMutableProperties.cs b/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/Models/DedicatedCapacityMutableProperties.cs new file mode 100644 index 000000000000..61c435c77b48 --- /dev/null +++ b/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/Models/DedicatedCapacityMutableProperties.cs @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.PowerBIDedicated.Models +{ + using System.Linq; + + /// + /// An object that represents a set of mutable Dedicated capacity resource + /// properties. + /// + public partial class DedicatedCapacityMutableProperties + { + /// + /// Initializes a new instance of the DedicatedCapacityMutableProperties class. + /// + public DedicatedCapacityMutableProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the DedicatedCapacityMutableProperties class. + /// + + /// A collection of Dedicated capacity administrators + /// + public DedicatedCapacityMutableProperties(DedicatedCapacityAdministrators administration = default(DedicatedCapacityAdministrators)) + + { + this.Administration = administration; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets a collection of Dedicated capacity administrators + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "administration")] + public DedicatedCapacityAdministrators Administration {get; set; } + } +} \ No newline at end of file diff --git a/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/Models/DedicatedCapacityProperties.cs b/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/Models/DedicatedCapacityProperties.cs new file mode 100644 index 000000000000..ddecf52c4a8d --- /dev/null +++ b/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/Models/DedicatedCapacityProperties.cs @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.PowerBIDedicated.Models +{ + using System.Linq; + + /// + /// Properties of Dedicated Capacity resource. + /// + public partial class DedicatedCapacityProperties : DedicatedCapacityMutableProperties + { + /// + /// Initializes a new instance of the DedicatedCapacityProperties class. + /// + public DedicatedCapacityProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the DedicatedCapacityProperties class. + /// + + /// A collection of Dedicated capacity administrators + /// + + /// The current state of PowerBI Dedicated resource. The state is to indicate + /// more states outside of resource provisioning. + /// Possible values include: 'Deleting', 'Succeeded', 'Failed', 'Paused', + /// 'Suspended', 'Provisioning', 'Updating', 'Suspending', 'Pausing', + /// 'Resuming', 'Preparing', 'Scaling' + + /// The current deployment state of PowerBI Dedicatedresource. The + /// provisioningState is to indicate states for resource provisioning. + /// Possible values include: 'Deleting', 'Succeeded', 'Failed', 'Paused', + /// 'Suspended', 'Provisioning', 'Updating', 'Suspending', 'Pausing', + /// 'Resuming', 'Preparing', 'Scaling' + public DedicatedCapacityProperties(DedicatedCapacityAdministrators administration = default(DedicatedCapacityAdministrators), string state = default(string), string provisioningState = default(string)) + + : base(administration) + { + this.State = state; + this.ProvisioningState = provisioningState; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets the current state of PowerBI Dedicated resource. The state is to + /// indicate more states outside of resource provisioning. Possible values include: 'Deleting', 'Succeeded', 'Failed', 'Paused', 'Suspended', 'Provisioning', 'Updating', 'Suspending', 'Pausing', 'Resuming', 'Preparing', 'Scaling' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "state")] + public string State {get; private set; } + + /// + /// Gets the current deployment state of PowerBI Dedicatedresource. The + /// provisioningState is to indicate states for resource provisioning. Possible values include: 'Deleting', 'Succeeded', 'Failed', 'Paused', 'Suspended', 'Provisioning', 'Updating', 'Suspending', 'Pausing', 'Resuming', 'Preparing', 'Scaling' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + } +} \ No newline at end of file diff --git a/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/Models/DedicatedCapacityUpdateParameters.cs b/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/Models/DedicatedCapacityUpdateParameters.cs index 72381dbcc672..3f994e2d89b5 100644 --- a/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/Models/DedicatedCapacityUpdateParameters.cs +++ b/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/Models/DedicatedCapacityUpdateParameters.cs @@ -1,31 +1,20 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.PowerBIDedicated.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// Provision request specification /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class DedicatedCapacityUpdateParameters { /// - /// Initializes a new instance of the DedicatedCapacityUpdateParameters - /// class. + /// Initializes a new instance of the DedicatedCapacityUpdateParameters class. /// public DedicatedCapacityUpdateParameters() { @@ -33,20 +22,23 @@ public DedicatedCapacityUpdateParameters() } /// - /// Initializes a new instance of the DedicatedCapacityUpdateParameters - /// class. + /// Initializes a new instance of the DedicatedCapacityUpdateParameters class. /// - /// The SKU of the Dedicated capacity - /// resource. - /// Key-value pairs of additional provisioning - /// properties. - /// A collection of Dedicated capacity - /// administrators - public DedicatedCapacityUpdateParameters(ResourceSku sku = default(ResourceSku), IDictionary tags = default(IDictionary), DedicatedCapacityAdministrators administration = default(DedicatedCapacityAdministrators)) + + /// The SKU of the Dedicated capacity resource. + /// + + /// Key-value pairs of additional provisioning properties. + /// + + /// A collection of Dedicated capacity administrators + /// + public DedicatedCapacityUpdateParameters(ResourceSku sku = default(ResourceSku), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), DedicatedCapacityAdministrators administration = default(DedicatedCapacityAdministrators)) + { - Sku = sku; - Tags = tags; - Administration = administration; + this.Sku = sku; + this.Tags = tags; + this.Administration = administration; CustomInit(); } @@ -55,36 +47,38 @@ public DedicatedCapacityUpdateParameters() /// partial void CustomInit(); + /// /// Gets or sets the SKU of the Dedicated capacity resource. /// - [JsonProperty(PropertyName = "sku")] - public ResourceSku Sku { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "sku")] + public ResourceSku Sku {get; set; } /// /// Gets or sets key-value pairs of additional provisioning properties. /// - [JsonProperty(PropertyName = "tags")] - public IDictionary Tags { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "tags")] + public System.Collections.Generic.IDictionary Tags {get; set; } /// /// Gets or sets a collection of Dedicated capacity administrators /// - [JsonProperty(PropertyName = "properties.administration")] - public DedicatedCapacityAdministrators Administration { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.administration")] + public DedicatedCapacityAdministrators Administration {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (Sku != null) + if (this.Sku != null) { - Sku.Validate(); + this.Sku.Validate(); } + + } } -} +} \ No newline at end of file diff --git a/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/Models/ErrorResponse.cs b/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/Models/ErrorResponse.cs index cdecd42c60a4..de05400f242f 100644 --- a/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/Models/ErrorResponse.cs +++ b/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/Models/ErrorResponse.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.PowerBIDedicated.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,13 +23,17 @@ public ErrorResponse() /// /// Initializes a new instance of the ErrorResponse class. /// - /// Error code - /// Error message indicating why the operation - /// failed. + + /// Error code + /// + + /// Error message indicating why the operation failed. + /// public ErrorResponse(string code = default(string), string message = default(string)) + { - Code = code; - Message = message; + this.Code = code; + this.Message = message; CustomInit(); } @@ -44,17 +42,17 @@ public ErrorResponse() /// partial void CustomInit(); + /// /// Gets or sets error code /// - [JsonProperty(PropertyName = "code")] - public string Code { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "code")] + public string Code {get; set; } /// /// Gets or sets error message indicating why the operation failed. /// - [JsonProperty(PropertyName = "message")] - public string Message { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "message")] + public string Message {get; set; } } -} +} \ No newline at end of file diff --git a/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/Models/ErrorResponseException.cs b/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/Models/ErrorResponseException.cs index cfd05966349c..07354b12e064 100644 --- a/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/Models/ErrorResponseException.cs +++ b/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/Models/ErrorResponseException.cs @@ -1,32 +1,25 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.PowerBIDedicated.Models { - using Microsoft.Rest; /// - /// Exception thrown for an invalid response with ErrorResponse - /// information. + /// Exception thrown for an invalid response with ErrorResponse information. /// - public partial class ErrorResponseException : RestException + public partial class ErrorResponseException : Microsoft.Rest.RestException { /// /// Gets information about the associated HTTP request. /// - public HttpRequestMessageWrapper Request { get; set; } + public Microsoft.Rest.HttpRequestMessageWrapper Request { get; set; } /// /// Gets information about the associated HTTP response. /// - public HttpResponseMessageWrapper Response { get; set; } + public Microsoft.Rest.HttpResponseMessageWrapper Response { get; set; } /// /// Gets or sets the body object. @@ -41,7 +34,7 @@ public ErrorResponseException() } /// - /// Initializes a new instance of the ErrorResponseException class. + /// Initializes a new instance of the ErrorResponse class. /// /// The exception message. public ErrorResponseException(string message) @@ -50,7 +43,7 @@ public ErrorResponseException(string message) } /// - /// Initializes a new instance of the ErrorResponseException class. + /// Initializes a new instance of the ErrorResponse class. /// /// The exception message. /// Inner exception. @@ -59,4 +52,4 @@ public ErrorResponseException(string message, System.Exception innerException) { } } -} +} \ No newline at end of file diff --git a/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/Models/Operation.cs b/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/Models/Operation.cs index 9b3aa76597e4..e2d10fe91357 100644 --- a/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/Models/Operation.cs +++ b/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/Models/Operation.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.PowerBIDedicated.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,14 +23,17 @@ public Operation() /// /// Initializes a new instance of the Operation class. /// - /// Operation name: - /// {provider}/{resource}/{operation}. - /// The object that represents the - /// operation. + + /// Operation name: {provider}/{resource}/{operation}. + /// + + /// The object that represents the operation. + /// public Operation(string name = default(string), OperationDisplay display = default(OperationDisplay)) + { - Name = name; - Display = display; + this.Name = name; + this.Display = display; CustomInit(); } @@ -45,17 +42,17 @@ public Operation() /// partial void CustomInit(); + /// /// Gets operation name: {provider}/{resource}/{operation}. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; private set; } /// /// Gets or sets the object that represents the operation. /// - [JsonProperty(PropertyName = "display")] - public OperationDisplay Display { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "display")] + public OperationDisplay Display {get; set; } } -} +} \ No newline at end of file diff --git a/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/Models/OperationDisplay.cs b/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/Models/OperationDisplay.cs index ab9378af4e1c..2326292f4f55 100644 --- a/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/Models/OperationDisplay.cs +++ b/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/Models/OperationDisplay.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.PowerBIDedicated.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,17 +23,21 @@ public OperationDisplay() /// /// Initializes a new instance of the OperationDisplay class. /// - /// Service provider: - /// Microsoft.PowerBIDedicated. - /// Resource on which the operation is - /// performed: capacity, etc. - /// Operation type: create, update, delete, - /// etc. + + /// Service provider: Microsoft.PowerBIDedicated. + /// + + /// Resource on which the operation is performed: capacity, etc. + /// + + /// Operation type: create, update, delete, etc. + /// public OperationDisplay(string provider = default(string), string resource = default(string), string operation = default(string)) + { - Provider = provider; - Resource = resource; - Operation = operation; + this.Provider = provider; + this.Resource = resource; + this.Operation = operation; CustomInit(); } @@ -48,23 +46,23 @@ public OperationDisplay() /// partial void CustomInit(); + /// /// Gets service provider: Microsoft.PowerBIDedicated. /// - [JsonProperty(PropertyName = "provider")] - public string Provider { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "provider")] + public string Provider {get; private set; } /// /// Gets resource on which the operation is performed: capacity, etc. /// - [JsonProperty(PropertyName = "resource")] - public string Resource { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "resource")] + public string Resource {get; private set; } /// /// Gets operation type: create, update, delete, etc. /// - [JsonProperty(PropertyName = "operation")] - public string Operation { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "operation")] + public string Operation {get; private set; } } -} +} \ No newline at end of file diff --git a/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/Models/Page.cs b/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/Models/Page.cs index e42e9a070292..2829c4caa207 100644 --- a/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/Models/Page.cs +++ b/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/Models/Page.cs @@ -1,53 +1,43 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + namespace Microsoft.Azure.Management.PowerBIDedicated.Models { - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; /// /// Defines a page in Azure responses. /// /// Type of the page content items - [JsonObject] - public class Page : IPage + [Newtonsoft.Json.JsonObject] + public class Page : Microsoft.Rest.Azure.IPage { - /// - /// Gets the link to the next page. - /// - [JsonProperty("")] - public string NextPageLink { get; private set; } - - [JsonProperty("value")] - private IList Items{ get; set; } - - /// - /// Returns an enumerator that iterates through the collection. - /// - /// A an enumerator that can be used to iterate through the collection. - public IEnumerator GetEnumerator() - { - return Items == null ? System.Linq.Enumerable.Empty().GetEnumerator() : Items.GetEnumerator(); - } - - /// - /// Returns an enumerator that iterates through the collection. - /// - /// A an enumerator that can be used to iterate through the collection. - IEnumerator IEnumerable.GetEnumerator() - { - return GetEnumerator(); - } + /// + /// Gets the link to the next page. + /// + [Newtonsoft.Json.JsonProperty("")] + public System.String NextPageLink { get; private set; } + + [Newtonsoft.Json.JsonProperty("value")] + private System.Collections.Generic.IList Items{ get; set; } + + /// + /// Returns an enumerator that iterates through the collection. + /// + /// A an enumerator that can be used to iterate through the collection. + public System.Collections.Generic.IEnumerator GetEnumerator() + { + return (Items == null) ? System.Linq.Enumerable.Empty().GetEnumerator() : Items.GetEnumerator(); + } + + /// + /// Returns an enumerator that iterates through the collection. + /// + /// A an enumerator that can be used to iterate through the collection. + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } } -} +} \ No newline at end of file diff --git a/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/Models/Page1.cs b/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/Models/Page1.cs index b8b0151a7c29..d1a0445c554e 100644 --- a/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/Models/Page1.cs +++ b/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/Models/Page1.cs @@ -1,53 +1,43 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + namespace Microsoft.Azure.Management.PowerBIDedicated.Models { - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; /// /// Defines a page in Azure responses. /// /// Type of the page content items - [JsonObject] - public class Page1 : IPage + [Newtonsoft.Json.JsonObject] + public class Page1 : Microsoft.Rest.Azure.IPage { - /// - /// Gets the link to the next page. - /// - [JsonProperty("nextLink")] - public string NextPageLink { get; private set; } - - [JsonProperty("value")] - private IList Items{ get; set; } - - /// - /// Returns an enumerator that iterates through the collection. - /// - /// A an enumerator that can be used to iterate through the collection. - public IEnumerator GetEnumerator() - { - return Items == null ? System.Linq.Enumerable.Empty().GetEnumerator() : Items.GetEnumerator(); - } - - /// - /// Returns an enumerator that iterates through the collection. - /// - /// A an enumerator that can be used to iterate through the collection. - IEnumerator IEnumerable.GetEnumerator() - { - return GetEnumerator(); - } + /// + /// Gets the link to the next page. + /// + [Newtonsoft.Json.JsonProperty("nextLink")] + public System.String NextPageLink { get; private set; } + + [Newtonsoft.Json.JsonProperty("value")] + private System.Collections.Generic.IList Items{ get; set; } + + /// + /// Returns an enumerator that iterates through the collection. + /// + /// A an enumerator that can be used to iterate through the collection. + public System.Collections.Generic.IEnumerator GetEnumerator() + { + return (Items == null) ? System.Linq.Enumerable.Empty().GetEnumerator() : Items.GetEnumerator(); + } + + /// + /// Returns an enumerator that iterates through the collection. + /// + /// A an enumerator that can be used to iterate through the collection. + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } } -} +} \ No newline at end of file diff --git a/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/Models/ProvisioningState.cs b/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/Models/ProvisioningState.cs index 7296bd306616..178cd04ec905 100644 --- a/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/Models/ProvisioningState.cs +++ b/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/Models/ProvisioningState.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.PowerBIDedicated.Models { @@ -14,6 +9,8 @@ namespace Microsoft.Azure.Management.PowerBIDedicated.Models /// /// Defines values for ProvisioningState. /// + + public static class ProvisioningState { public const string Deleting = "Deleting"; @@ -29,4 +26,4 @@ public static class ProvisioningState public const string Preparing = "Preparing"; public const string Scaling = "Scaling"; } -} +} \ No newline at end of file diff --git a/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/Models/Resource.cs b/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/Models/Resource.cs index b17cd1ef1108..5225afec8540 100644 --- a/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/Models/Resource.cs +++ b/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/Models/Resource.cs @@ -1,26 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.PowerBIDedicated.Models { - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// Represents an instance of an PowerBI Dedicated resource. /// - public partial class Resource : IResource + public partial class Resource : Microsoft.Rest.Azure.IResource { /// /// Initializes a new instance of the Resource class. @@ -33,26 +23,33 @@ public Resource() /// /// Initializes a new instance of the Resource class. /// - /// Location of the PowerBI Dedicated - /// resource. - /// The SKU of the PowerBI Dedicated - /// resource. - /// An identifier that represents the PowerBI - /// Dedicated resource. - /// The name of the PowerBI Dedicated - /// resource. - /// The type of the PowerBI Dedicated - /// resource. - /// Key-value pairs of additional resource - /// provisioning properties. - public Resource(string location, ResourceSku sku, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary)) + + /// An identifier that represents the PowerBI Dedicated resource. + /// + + /// The name of the PowerBI Dedicated resource. + /// + + /// The type of the PowerBI Dedicated resource. + /// + + /// Location of the PowerBI Dedicated resource. + /// + + /// The SKU of the PowerBI Dedicated resource. + /// + + /// Key-value pairs of additional resource provisioning properties. + /// + public Resource(string location, ResourceSku sku, string id = default(string), string name = default(string), string type = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary)) + { - Id = id; - Name = name; - Type = type; - Location = location; - Sku = sku; - Tags = tags; + this.Id = id; + this.Name = name; + this.Type = type; + this.Location = location; + this.Sku = sku; + this.Tags = tags; CustomInit(); } @@ -61,63 +58,68 @@ public Resource() /// partial void CustomInit(); + /// /// Gets an identifier that represents the PowerBI Dedicated resource. /// - [JsonProperty(PropertyName = "id")] - public string Id { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "id")] + public string Id {get; private set; } /// /// Gets the name of the PowerBI Dedicated resource. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; private set; } /// /// Gets the type of the PowerBI Dedicated resource. /// - [JsonProperty(PropertyName = "type")] - public string Type { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; private set; } /// /// Gets or sets location of the PowerBI Dedicated resource. /// - [JsonProperty(PropertyName = "location")] - public string Location { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "location")] + public string Location {get; set; } /// /// Gets or sets the SKU of the PowerBI Dedicated resource. /// - [JsonProperty(PropertyName = "sku")] - public ResourceSku Sku { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "sku")] + public ResourceSku Sku {get; set; } /// /// Gets or sets key-value pairs of additional resource provisioning /// properties. /// - [JsonProperty(PropertyName = "tags")] - public IDictionary Tags { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "tags")] + public System.Collections.Generic.IDictionary Tags {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (Location == null) + if (this.Location == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "Location"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Location"); } - if (Sku == null) + if (this.Sku == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "Sku"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Sku"); } - if (Sku != null) + + + + + if (this.Sku != null) { - Sku.Validate(); + this.Sku.Validate(); } + } } -} +} \ No newline at end of file diff --git a/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/Models/ResourceSku.cs b/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/Models/ResourceSku.cs index 1518b79bdd06..c55ff5d4298b 100644 --- a/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/Models/ResourceSku.cs +++ b/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/Models/ResourceSku.cs @@ -1,17 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.PowerBIDedicated.Models { - using Microsoft.Rest; - using Newtonsoft.Json; using System.Linq; /// @@ -31,13 +24,17 @@ public ResourceSku() /// /// Initializes a new instance of the ResourceSku class. /// - /// Name of the SKU level. - /// The name of the Azure pricing tier to which the - /// SKU applies. Possible values include: 'PBIE_Azure' + + /// Name of the SKU level. + /// + + /// The name of the Azure pricing tier to which the SKU applies. + /// Possible values include: 'PBIE_Azure' public ResourceSku(string name, string tier = default(string)) + { - Name = name; - Tier = tier; + this.Name = name; + this.Tier = tier; CustomInit(); } @@ -46,31 +43,32 @@ public ResourceSku() /// partial void CustomInit(); + /// /// Gets or sets name of the SKU level. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// - /// Gets or sets the name of the Azure pricing tier to which the SKU - /// applies. Possible values include: 'PBIE_Azure' + /// Gets or sets the name of the Azure pricing tier to which the SKU applies. Possible values include: 'PBIE_Azure' /// - [JsonProperty(PropertyName = "tier")] - public string Tier { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "tier")] + public string Tier {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (Name == null) + if (this.Name == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "Name"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Name"); } + + } } -} +} \ No newline at end of file diff --git a/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/Models/SkuDetailsForExistingResource.cs b/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/Models/SkuDetailsForExistingResource.cs index 4880d366e38e..c502568dc78d 100644 --- a/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/Models/SkuDetailsForExistingResource.cs +++ b/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/Models/SkuDetailsForExistingResource.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.PowerBIDedicated.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -19,8 +13,7 @@ namespace Microsoft.Azure.Management.PowerBIDedicated.Models public partial class SkuDetailsForExistingResource { /// - /// Initializes a new instance of the SkuDetailsForExistingResource - /// class. + /// Initializes a new instance of the SkuDetailsForExistingResource class. /// public SkuDetailsForExistingResource() { @@ -28,14 +21,15 @@ public SkuDetailsForExistingResource() } /// - /// Initializes a new instance of the SkuDetailsForExistingResource - /// class. + /// Initializes a new instance of the SkuDetailsForExistingResource class. /// - /// The SKU in SKU details for existing - /// resources. + + /// The SKU in SKU details for existing resources. + /// public SkuDetailsForExistingResource(ResourceSku sku = default(ResourceSku)) + { - Sku = sku; + this.Sku = sku; CustomInit(); } @@ -44,24 +38,24 @@ public SkuDetailsForExistingResource() /// partial void CustomInit(); + /// /// Gets or sets the SKU in SKU details for existing resources. /// - [JsonProperty(PropertyName = "sku")] - public ResourceSku Sku { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "sku")] + public ResourceSku Sku {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (Sku != null) + if (this.Sku != null) { - Sku.Validate(); + this.Sku.Validate(); } } } -} +} \ No newline at end of file diff --git a/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/Models/SkuEnumerationForExistingResourceResult.cs b/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/Models/SkuEnumerationForExistingResourceResult.cs index 5572990a3727..6835013669d8 100644 --- a/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/Models/SkuEnumerationForExistingResourceResult.cs +++ b/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/Models/SkuEnumerationForExistingResourceResult.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.PowerBIDedicated.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -21,8 +13,7 @@ namespace Microsoft.Azure.Management.PowerBIDedicated.Models public partial class SkuEnumerationForExistingResourceResult { /// - /// Initializes a new instance of the - /// SkuEnumerationForExistingResourceResult class. + /// Initializes a new instance of the SkuEnumerationForExistingResourceResult class. /// public SkuEnumerationForExistingResourceResult() { @@ -30,14 +21,15 @@ public SkuEnumerationForExistingResourceResult() } /// - /// Initializes a new instance of the - /// SkuEnumerationForExistingResourceResult class. + /// Initializes a new instance of the SkuEnumerationForExistingResourceResult class. /// - /// The collection of available SKUs for existing - /// resources - public SkuEnumerationForExistingResourceResult(IList value = default(IList)) + + /// The collection of available SKUs for existing resources + /// + public SkuEnumerationForExistingResourceResult(System.Collections.Generic.IList value = default(System.Collections.Generic.IList)) + { - Value = value; + this.Value = value; CustomInit(); } @@ -46,12 +38,11 @@ public SkuEnumerationForExistingResourceResult() /// partial void CustomInit(); + /// - /// Gets or sets the collection of available SKUs for existing - /// resources + /// Gets or sets the collection of available SKUs for existing resources /// - [JsonProperty(PropertyName = "value")] - public IList Value { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "value")] + public System.Collections.Generic.IList Value {get; set; } } -} +} \ No newline at end of file diff --git a/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/Models/SkuEnumerationForNewResourceResult.cs b/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/Models/SkuEnumerationForNewResourceResult.cs index 540b0ee7e973..14127ccd697e 100644 --- a/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/Models/SkuEnumerationForNewResourceResult.cs +++ b/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/Models/SkuEnumerationForNewResourceResult.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.PowerBIDedicated.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -21,8 +13,7 @@ namespace Microsoft.Azure.Management.PowerBIDedicated.Models public partial class SkuEnumerationForNewResourceResult { /// - /// Initializes a new instance of the - /// SkuEnumerationForNewResourceResult class. + /// Initializes a new instance of the SkuEnumerationForNewResourceResult class. /// public SkuEnumerationForNewResourceResult() { @@ -30,14 +21,15 @@ public SkuEnumerationForNewResourceResult() } /// - /// Initializes a new instance of the - /// SkuEnumerationForNewResourceResult class. + /// Initializes a new instance of the SkuEnumerationForNewResourceResult class. /// - /// The collection of available SKUs for new - /// resources - public SkuEnumerationForNewResourceResult(IList value = default(IList)) + + /// The collection of available SKUs for new resources + /// + public SkuEnumerationForNewResourceResult(System.Collections.Generic.IList value = default(System.Collections.Generic.IList)) + { - Value = value; + this.Value = value; CustomInit(); } @@ -46,11 +38,11 @@ public SkuEnumerationForNewResourceResult() /// partial void CustomInit(); + /// /// Gets or sets the collection of available SKUs for new resources /// - [JsonProperty(PropertyName = "value")] - public IList Value { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "value")] + public System.Collections.Generic.IList Value {get; set; } } -} +} \ No newline at end of file diff --git a/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/Models/SkuTier.cs b/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/Models/SkuTier.cs index f7af61d620d1..db7638dfb8d0 100644 --- a/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/Models/SkuTier.cs +++ b/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/Models/SkuTier.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.PowerBIDedicated.Models { @@ -14,8 +9,10 @@ namespace Microsoft.Azure.Management.PowerBIDedicated.Models /// /// Defines values for SkuTier. /// + + public static class SkuTier { - public const string PBIEAzure = "PBIE_Azure"; + public const string PbieAzure = "PBIE_Azure"; } -} +} \ No newline at end of file diff --git a/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/Models/State.cs b/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/Models/State.cs index 962a375c909f..ae8f38c3ab50 100644 --- a/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/Models/State.cs +++ b/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/Models/State.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.PowerBIDedicated.Models { @@ -14,6 +9,8 @@ namespace Microsoft.Azure.Management.PowerBIDedicated.Models /// /// Defines values for State. /// + + public static class State { public const string Deleting = "Deleting"; @@ -29,4 +26,4 @@ public static class State public const string Preparing = "Preparing"; public const string Scaling = "Scaling"; } -} +} \ No newline at end of file diff --git a/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/Operations.cs b/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/Operations.cs index 55c8c2176602..ea15f5c8f84e 100644 --- a/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/Operations.cs +++ b/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/Operations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.PowerBIDedicated { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// Operations operations. /// - internal partial class Operations : IServiceOperations, IOperations + internal partial class Operations : Microsoft.Rest.IServiceOperations, IOperations { /// /// Initializes a new instance of the Operations class. @@ -36,13 +24,13 @@ internal partial class Operations : IServiceOperations /// Thrown when a required parameter is null /// - internal Operations(PowerBIDedicatedManagementClient client) + internal Operations (PowerBIDedicatedManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -59,13 +47,13 @@ internal Operations(PowerBIDedicatedManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -74,54 +62,62 @@ internal Operations(PowerBIDedicatedManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.ApiVersion == null) + + + + + if (this.Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.PowerBIDedicated/operations").ToString(); - List _queryParameters = new List(); - if (Client.ApiVersion != null) + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -133,50 +129,51 @@ internal Operations(PowerBIDedicatedManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -186,9 +183,10 @@ internal Operations(PowerBIDedicatedManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -199,25 +197,29 @@ internal Operations(PowerBIDedicatedManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Lists all of the available PowerBIDedicated REST API operations. /// @@ -230,13 +232,13 @@ internal Operations(PowerBIDedicatedManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -245,51 +247,54 @@ internal Operations(PowerBIDedicatedManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -301,50 +306,51 @@ internal Operations(PowerBIDedicatedManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -354,9 +360,10 @@ internal Operations(PowerBIDedicatedManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -367,24 +374,28 @@ internal Operations(PowerBIDedicatedManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/OperationsExtensions.cs b/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/OperationsExtensions.cs index ffbe0b160963..1b82fe96ac86 100644 --- a/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/OperationsExtensions.cs +++ b/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/OperationsExtensions.cs @@ -1,87 +1,76 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.PowerBIDedicated { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for Operations. + /// Extension methods for Operations /// public static partial class OperationsExtensions { - /// - /// Lists all of the available PowerBIDedicated REST API operations. - /// - /// - /// The operations group for this extension method. - /// - public static IPage List(this IOperations operations) - { - return operations.ListAsync().GetAwaiter().GetResult(); - } + /// + /// Lists all of the available PowerBIDedicated REST API operations. + /// + /// + /// The operations group for this extension method. + /// + public static Microsoft.Rest.Azure.IPage List(this IOperations operations) + { + return ((IOperations)operations).ListAsync().GetAwaiter().GetResult(); + } - /// - /// Lists all of the available PowerBIDedicated REST API operations. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this IOperations operations, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Lists all of the available PowerBIDedicated REST API operations. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this IOperations operations, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Lists all of the available PowerBIDedicated REST API operations. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListNext(this IOperations operations, string nextPageLink) + { + return ((IOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// Lists all of the available PowerBIDedicated REST API operations. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this IOperations operations, string nextPageLink) + /// + /// Lists all of the available PowerBIDedicated REST API operations. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListNextAsync(this IOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + return _result.Body; } - - /// - /// Lists all of the available PowerBIDedicated REST API operations. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListNextAsync(this IOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - + } } } diff --git a/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/PowerBIDedicatedManagementClient.cs b/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/PowerBIDedicatedManagementClient.cs index 17b1a7f0c261..3126e0224b7d 100644 --- a/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/PowerBIDedicatedManagementClient.cs +++ b/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/PowerBIDedicatedManagementClient.cs @@ -1,92 +1,76 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.PowerBIDedicated { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; - using Microsoft.Rest.Serialization; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; /// /// PowerBI Dedicated Web API provides a RESTful set of web services that - /// enables users to create, retrieve, update, and delete Power BI - /// dedicated capacities + /// enables users to create, retrieve, update, and delete Power BI dedicated + /// capacities /// - public partial class PowerBIDedicatedManagementClient : ServiceClient, IPowerBIDedicatedManagementClient, IAzureClient + public partial class PowerBIDedicatedManagementClient : Microsoft.Rest.ServiceClient, IPowerBIDedicatedManagementClient, IAzureClient { /// /// The base URI of the service. /// public System.Uri BaseUri { get; set; } - /// /// Gets or sets json serialization settings. /// - public JsonSerializerSettings SerializationSettings { get; private set; } - + public Newtonsoft.Json.JsonSerializerSettings SerializationSettings { get; private set; } /// /// Gets or sets json deserialization settings. /// - public JsonSerializerSettings DeserializationSettings { get; private set; } - + public Newtonsoft.Json.JsonSerializerSettings DeserializationSettings { get; private set; } /// /// Credentials needed for the client to connect to Azure. /// - public ServiceClientCredentials Credentials { get; private set; } + public Microsoft.Rest.ServiceClientCredentials Credentials { get; private set; } /// - /// A unique identifier for a Microsoft Azure subscription. The subscription ID - /// forms part of the URI for every service call. + /// The API version to use for this operation. /// - public string SubscriptionId { get; set; } + public string ApiVersion { get; private set; } /// - /// The client API version. + /// A unique identifier for a Microsoft Azure subscription. The subscription ID + /// forms part of the URI for every service call. /// - public string ApiVersion { get; private set; } + public string SubscriptionId { get; set;} /// /// The preferred language for the response. /// - public string AcceptLanguage { get; set; } + public string AcceptLanguage { get; set;} /// - /// The retry timeout in seconds for Long Running Operations. Default value is - /// 30. + /// The retry timeout in seconds for Long Running Operations. Default + /// /// value is 30. /// - public int? LongRunningOperationRetryTimeout { get; set; } + public int? LongRunningOperationRetryTimeout { get; set;} /// - /// Whether a unique x-ms-client-request-id should be generated. When set to - /// true a unique x-ms-client-request-id value is generated and included in - /// each request. Default is true. + /// Whether a unique x-ms-client-request-id should be generated. When + /// /// set to true a unique x-ms-client-request-id value is generated and + /// /// included in each request. Default is true. /// - public bool? GenerateClientRequestId { get; set; } + public bool? GenerateClientRequestId { get; set;} /// - /// Gets the ICapacitiesOperations. + /// Gets the ICapacitiesOperations /// public virtual ICapacitiesOperations Capacities { get; private set; } - /// - /// Gets the IOperations. + /// Gets the IOperations /// public virtual IOperations Operations { get; private set; } - /// /// Initializes a new instance of the PowerBIDedicatedManagementClient class. /// @@ -95,24 +79,22 @@ public partial class PowerBIDedicatedManagementClient : ServiceClient /// /// True: will dispose the provided httpClient on calling PowerBIDedicatedManagementClient.Dispose(). False: will not dispose provided httpClient - protected PowerBIDedicatedManagementClient(HttpClient httpClient, bool disposeHttpClient) : base(httpClient, disposeHttpClient) + protected PowerBIDedicatedManagementClient(System.Net.Http.HttpClient httpClient, bool disposeHttpClient) : base(httpClient, disposeHttpClient) { - Initialize(); + this.Initialize(); } - /// /// Initializes a new instance of the PowerBIDedicatedManagementClient class. /// /// /// Optional. The delegating handlers to add to the http client pipeline. /// - protected PowerBIDedicatedManagementClient(params DelegatingHandler[] handlers) : base(handlers) + protected PowerBIDedicatedManagementClient(params System.Net.Http.DelegatingHandler[] handlers) : base(handlers) { - Initialize(); + this.Initialize(); } - /// - /// Initializes a new instance of the PowerBIDedicatedManagementClient class. + /// Initializes a new instance of the PowerBIDedicatedManagementClient class. /// /// /// Optional. The http client handler used to handle http transport. @@ -120,11 +102,10 @@ protected PowerBIDedicatedManagementClient(params DelegatingHandler[] handlers) /// /// Optional. The delegating handlers to add to the http client pipeline. /// - protected PowerBIDedicatedManagementClient(HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : base(rootHandler, handlers) + protected PowerBIDedicatedManagementClient(System.Net.Http.HttpClientHandler rootHandler, params System.Net.Http.DelegatingHandler[] handlers) : base(rootHandler, handlers) { - Initialize(); + this.Initialize(); } - /// /// Initializes a new instance of the PowerBIDedicatedManagementClient class. /// @@ -137,15 +118,14 @@ protected PowerBIDedicatedManagementClient(HttpClientHandler rootHandler, params /// /// Thrown when a required parameter is null /// - protected PowerBIDedicatedManagementClient(System.Uri baseUri, params DelegatingHandler[] handlers) : this(handlers) + protected PowerBIDedicatedManagementClient(System.Uri baseUri, params System.Net.Http.DelegatingHandler[] handlers) : this(handlers) { if (baseUri == null) { throw new System.ArgumentNullException("baseUri"); } - BaseUri = baseUri; + this.BaseUri = baseUri; } - /// /// Initializes a new instance of the PowerBIDedicatedManagementClient class. /// @@ -161,15 +141,15 @@ protected PowerBIDedicatedManagementClient(System.Uri baseUri, params Delegating /// /// Thrown when a required parameter is null /// - protected PowerBIDedicatedManagementClient(System.Uri baseUri, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers) + protected PowerBIDedicatedManagementClient(System.Uri baseUri, System.Net.Http.HttpClientHandler rootHandler, params System.Net.Http.DelegatingHandler[] handlers) : this(rootHandler, handlers) { if (baseUri == null) { throw new System.ArgumentNullException("baseUri"); } - BaseUri = baseUri; + + this.BaseUri = baseUri; } - /// /// Initializes a new instance of the PowerBIDedicatedManagementClient class. /// @@ -182,23 +162,23 @@ protected PowerBIDedicatedManagementClient(System.Uri baseUri, HttpClientHandler /// /// Thrown when a required parameter is null /// - public PowerBIDedicatedManagementClient(ServiceClientCredentials credentials, params DelegatingHandler[] handlers) : this(handlers) + public PowerBIDedicatedManagementClient(Microsoft.Rest.ServiceClientCredentials credentials, params System.Net.Http.DelegatingHandler[] handlers) : this(handlers) { if (credentials == null) { throw new System.ArgumentNullException("credentials"); } - Credentials = credentials; - if (Credentials != null) + this.Credentials = credentials; + if (this.Credentials != null) { - Credentials.InitializeServiceClient(this); + this.Credentials.InitializeServiceClient(this); } + } - /// /// Initializes a new instance of the PowerBIDedicatedManagementClient class. /// - /// + /// /// Required. Credentials needed for the client to connect to Azure. /// /// @@ -209,23 +189,23 @@ public PowerBIDedicatedManagementClient(ServiceClientCredentials credentials, pa /// /// Thrown when a required parameter is null /// - public PowerBIDedicatedManagementClient(ServiceClientCredentials credentials, HttpClient httpClient, bool disposeHttpClient) : this(httpClient, disposeHttpClient) + public PowerBIDedicatedManagementClient(Microsoft.Rest.ServiceClientCredentials credentials, System.Net.Http.HttpClient httpClient, bool disposeHttpClient) : this(httpClient, disposeHttpClient) { if (credentials == null) { throw new System.ArgumentNullException("credentials"); } - Credentials = credentials; - if (Credentials != null) + this.Credentials = credentials; + if (this.Credentials != null) { - Credentials.InitializeServiceClient(this); + this.Credentials.InitializeServiceClient(this); } + } - /// /// Initializes a new instance of the PowerBIDedicatedManagementClient class. /// - /// + /// /// Required. Credentials needed for the client to connect to Azure. /// /// @@ -237,26 +217,26 @@ public PowerBIDedicatedManagementClient(ServiceClientCredentials credentials, Ht /// /// Thrown when a required parameter is null /// - public PowerBIDedicatedManagementClient(ServiceClientCredentials credentials, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers) + public PowerBIDedicatedManagementClient(Microsoft.Rest.ServiceClientCredentials credentials, System.Net.Http.HttpClientHandler rootHandler, params System.Net.Http.DelegatingHandler[] handlers) : this(rootHandler, handlers) { if (credentials == null) { throw new System.ArgumentNullException("credentials"); } - Credentials = credentials; - if (Credentials != null) + this.Credentials = credentials; + if (this.Credentials != null) { - Credentials.InitializeServiceClient(this); + this.Credentials.InitializeServiceClient(this); } + } - /// /// Initializes a new instance of the PowerBIDedicatedManagementClient class. /// /// /// Optional. The base URI of the service. /// - /// + /// /// Required. Credentials needed for the client to connect to Azure. /// /// @@ -265,7 +245,7 @@ public PowerBIDedicatedManagementClient(ServiceClientCredentials credentials, Ht /// /// Thrown when a required parameter is null /// - public PowerBIDedicatedManagementClient(System.Uri baseUri, ServiceClientCredentials credentials, params DelegatingHandler[] handlers) : this(handlers) + public PowerBIDedicatedManagementClient(System.Uri baseUri, Microsoft.Rest.ServiceClientCredentials credentials, params System.Net.Http.DelegatingHandler[] handlers) : this(handlers) { if (baseUri == null) { @@ -275,33 +255,30 @@ public PowerBIDedicatedManagementClient(System.Uri baseUri, ServiceClientCredent { throw new System.ArgumentNullException("credentials"); } - BaseUri = baseUri; - Credentials = credentials; - if (Credentials != null) + this.BaseUri = baseUri; + this.Credentials = credentials; + if (this.Credentials != null) { - Credentials.InitializeServiceClient(this); + this.Credentials.InitializeServiceClient(this); } + } - /// /// Initializes a new instance of the PowerBIDedicatedManagementClient class. /// /// /// Optional. The base URI of the service. /// - /// + /// /// Required. Credentials needed for the client to connect to Azure. /// /// /// Optional. The http client handler used to handle http transport. /// - /// - /// Optional. The delegating handlers to add to the http client pipeline. - /// /// /// Thrown when a required parameter is null /// - public PowerBIDedicatedManagementClient(System.Uri baseUri, ServiceClientCredentials credentials, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers) + public PowerBIDedicatedManagementClient(System.Uri baseUri, Microsoft.Rest.ServiceClientCredentials credentials, System.Net.Http.HttpClientHandler rootHandler, params System.Net.Http.DelegatingHandler[] handlers) : this(rootHandler, handlers) { if (baseUri == null) { @@ -311,59 +288,60 @@ public PowerBIDedicatedManagementClient(System.Uri baseUri, ServiceClientCredent { throw new System.ArgumentNullException("credentials"); } - BaseUri = baseUri; - Credentials = credentials; - if (Credentials != null) + this.BaseUri = baseUri; + this.Credentials = credentials; + if (this.Credentials != null) { - Credentials.InitializeServiceClient(this); + this.Credentials.InitializeServiceClient(this); } + } - /// /// An optional partial-method to perform custom initialization. /// partial void CustomInitialize(); + /// /// Initializes client properties. /// private void Initialize() { - Capacities = new CapacitiesOperations(this); - Operations = new Operations(this); - BaseUri = new System.Uri("https://management.azure.com"); - ApiVersion = "2017-10-01"; - AcceptLanguage = "en-US"; - LongRunningOperationRetryTimeout = 30; - GenerateClientRequestId = true; - SerializationSettings = new JsonSerializerSettings + this.Capacities = new CapacitiesOperations(this); + this.Operations = new Operations(this); + this.BaseUri = new System.Uri("https://management.azure.com"); + this.ApiVersion = "2017-10-01"; + this.AcceptLanguage = "en-US"; + this.LongRunningOperationRetryTimeout = 30; + this.GenerateClientRequestId = true; + SerializationSettings = new Newtonsoft.Json.JsonSerializerSettings { Formatting = Newtonsoft.Json.Formatting.Indented, DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat, DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore, ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize, - ContractResolver = new ReadOnlyJsonContractResolver(), - Converters = new List + ContractResolver = new Microsoft.Rest.Serialization.ReadOnlyJsonContractResolver(), + Converters = new System.Collections.Generic.List { - new Iso8601TimeSpanConverter() + new Microsoft.Rest.Serialization.Iso8601TimeSpanConverter() } }; - SerializationSettings.Converters.Add(new TransformationJsonConverter()); - DeserializationSettings = new JsonSerializerSettings + SerializationSettings.Converters.Add(new Microsoft.Rest.Serialization.TransformationJsonConverter()); + DeserializationSettings = new Newtonsoft.Json.JsonSerializerSettings { DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat, DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore, ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize, - ContractResolver = new ReadOnlyJsonContractResolver(), - Converters = new List + ContractResolver = new Microsoft.Rest.Serialization.ReadOnlyJsonContractResolver(), + Converters = new System.Collections.Generic.List { - new Iso8601TimeSpanConverter() + new Microsoft.Rest.Serialization.Iso8601TimeSpanConverter() } }; CustomInitialize(); - DeserializationSettings.Converters.Add(new TransformationJsonConverter()); - DeserializationSettings.Converters.Add(new CloudErrorJsonConverter()); + DeserializationSettings.Converters.Add(new Microsoft.Rest.Serialization.TransformationJsonConverter()); + DeserializationSettings.Converters.Add(new Microsoft.Rest.Azure.CloudErrorJsonConverter()); } } -} +} \ No newline at end of file diff --git a/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/SdkInfo_PowerBIDedicated.cs b/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/SdkInfo_PowerBIDedicated.cs deleted file mode 100644 index 29cefc19f816..000000000000 --- a/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/Generated/SdkInfo_PowerBIDedicated.cs +++ /dev/null @@ -1,28 +0,0 @@ - -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.PowerBIDedicated -{ - using System; - using System.Collections.Generic; - using System.Linq; - - internal static partial class SdkInfo - { - public static IEnumerable> ApiInfo_PowerBIDedicated - { - get - { - return new Tuple[] - { - new Tuple("PowerBIDedicated", "Capacities", "2017-10-01"), - new Tuple("PowerBIDedicated", "Operations", "2017-10-01"), - }.AsEnumerable(); - } - } - } -} diff --git a/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/README.md b/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/README.md index ab2b0a948e32..1ec7f6e08ec7 100644 --- a/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/README.md +++ b/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/README.md @@ -5,19 +5,20 @@ This directory contains management plane service clients of Az.Storage module. In this directory, run AutoRest: ``` autorest --reset -autorest --use:@microsoft.azure/autorest.csharp@2.3.90 -autorest.cmd README.md --version=v2 +autorest --use:@autorest/powershell@4.x ``` ### AutoRest Configuration > see https://aka.ms/autorest ``` yaml -csharp: true +isSdkGenerator: true +powershell: true clear-output-folder: true reflect-api-versions: true openapi-type: arm azure-arm: true license-header: MICROSOFT_MIT_NO_VERSION +title: PowerBIDedicatedManagementClient ``` diff --git a/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/IPowerBIEmbeddedManagementClient.cs b/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/IPowerBIEmbeddedManagementClient.cs index 88d97ae56e31..361284517796 100644 --- a/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/IPowerBIEmbeddedManagementClient.cs +++ b/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/IPowerBIEmbeddedManagementClient.cs @@ -1,29 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.PowerBIEmbedded { using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// - /// Client to manage your Power BI Embedded workspace collections and - /// retrieve workspaces. + /// Client to manage your Power BI Embedded workspace collections and retrieve + /// workspaces. /// - public partial interface IPowerBIEmbeddedManagementClient : System.IDisposable + public partial interface IPowerBIEmbeddedManagementClient : System.IDisposable { /// /// The base URI of the service. @@ -33,70 +23,85 @@ public partial interface IPowerBIEmbeddedManagementClient : System.IDisposable /// /// Gets or sets json serialization settings. /// - JsonSerializerSettings SerializationSettings { get; } + Newtonsoft.Json.JsonSerializerSettings SerializationSettings { get; } /// /// Gets or sets json deserialization settings. /// - JsonSerializerSettings DeserializationSettings { get; } + Newtonsoft.Json.JsonSerializerSettings DeserializationSettings { get; } /// /// Credentials needed for the client to connect to Azure. /// - ServiceClientCredentials Credentials { get; } + Microsoft.Rest.ServiceClientCredentials Credentials { get;} + /// - /// Gets subscription credentials which uniquely identify a Microsoft - /// Azure subscription. The subscription ID forms part of the URI for - /// every service call. + /// The API version to use for this operation. /// - string SubscriptionId { get; set; } + string ApiVersion { get;} + /// - /// Client Api Version. + /// Gets subscription credentials which uniquely identify a Microsoft Azure + /// subscription. The subscription ID forms part of the URI for every service + /// call. /// - string ApiVersion { get; } + string SubscriptionId { get; set;} + /// /// The preferred language for the response. /// - string AcceptLanguage { get; set; } + string AcceptLanguage { get; set;} + /// /// The retry timeout in seconds for Long Running Operations. Default - /// value is 30. + /// /// value is 30. /// - int? LongRunningOperationRetryTimeout { get; set; } + int? LongRunningOperationRetryTimeout { get; set;} + /// /// Whether a unique x-ms-client-request-id should be generated. When - /// set to true a unique x-ms-client-request-id value is generated and - /// included in each request. Default is true. + /// /// set to true a unique x-ms-client-request-id value is generated and + /// /// included in each request. Default is true. /// - bool? GenerateClientRequestId { get; set; } + bool? GenerateClientRequestId { get; set;} /// - /// Gets the IWorkspaceCollectionsOperations. + /// Gets the IWorkspaceCollectionsOperations /// IWorkspaceCollectionsOperations WorkspaceCollections { get; } /// - /// Gets the IWorkspacesOperations. + /// Gets the IWorkspacesOperations /// IWorkspacesOperations Workspaces { get; } /// - /// Indicates which operations can be performed by the Power BI - /// Resource Provider. + /// Indicates which operations can be performed by the Power BI Resource + /// Provider. /// + /// + /// Indicates which operations can be performed by the Power BI Resource + /// Provider. + /// /// /// The headers that will be added to request. /// /// /// The cancellation token. /// - Task> GetAvailableOperationsWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + System.Threading.Tasks.Task> GetAvailableOperationsWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); } -} +} \ No newline at end of file diff --git a/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/IWorkspaceCollectionsOperations.cs b/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/IWorkspaceCollectionsOperations.cs index 147603d35988..12f2a8964a34 100644 --- a/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/IWorkspaceCollectionsOperations.cs +++ b/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/IWorkspaceCollectionsOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.PowerBIEmbedded { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// WorkspaceCollectionsOperations operations. @@ -26,6 +16,9 @@ public partial interface IWorkspaceCollectionsOperations /// /// Retrieves an existing Power BI Workspace Collection. /// + /// + /// Retrieves an existing Power BI Workspace Collection. + /// /// /// Azure resource group /// @@ -38,22 +31,24 @@ public partial interface IWorkspaceCollectionsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetByNameWithHttpMessagesAsync(string resourceGroupName, string workspaceCollectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetByNameWithHttpMessagesAsync(string resourceGroupName, string workspaceCollectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Creates a new Power BI Workspace Collection with the specified - /// properties. A Power BI Workspace Collection contains one or more - /// workspaces, and can be used to provision keys that provide API - /// access to those workspaces. + /// Creates a new Power BI Workspace Collection with the specified properties. + /// A Power BI Workspace Collection contains one or more workspaces, and can be + /// used to provision keys that provide API access to those workspaces. /// + /// + /// Creates a new Power BI Workspace Collection with the specified properties. + /// A Power BI Workspace Collection contains one or more workspaces, and can be + /// used to provision keys that provide API access to those workspaces. + /// /// /// Azure resource group /// @@ -69,20 +64,22 @@ public partial interface IWorkspaceCollectionsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateWithHttpMessagesAsync(string resourceGroupName, string workspaceCollectionName, CreateWorkspaceCollectionRequest body, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CreateWithHttpMessagesAsync(string resourceGroupName, string workspaceCollectionName, CreateWorkspaceCollectionRequest body, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Update an existing Power BI Workspace Collection with the specified /// properties. /// + /// + /// Update an existing Power BI Workspace Collection with the specified + /// properties. + /// /// /// Azure resource group /// @@ -98,19 +95,20 @@ public partial interface IWorkspaceCollectionsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceCollectionName, UpdateWorkspaceCollectionRequest body, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceCollectionName, UpdateWorkspaceCollectionRequest body, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Delete a Power BI Workspace Collection. /// + /// + /// Delete a Power BI Workspace Collection. + /// /// /// Azure resource group /// @@ -123,17 +121,19 @@ public partial interface IWorkspaceCollectionsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string workspaceCollectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string workspaceCollectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Verify the specified Power BI Workspace Collection name is valid - /// and not already in use. + /// Verify the specified Power BI Workspace Collection name is valid and not + /// already in use. /// + /// + /// Verify the specified Power BI Workspace Collection name is valid and not + /// already in use. + /// /// /// Azure location /// @@ -146,20 +146,22 @@ public partial interface IWorkspaceCollectionsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CheckNameAvailabilityWithHttpMessagesAsync(string location, CheckNameRequest body, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CheckNameAvailabilityWithHttpMessagesAsync(string location, CheckNameRequest body, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Retrieves all existing Power BI workspace collections in the - /// specified resource group. + /// Retrieves all existing Power BI workspace collections in the specified + /// resource group. /// + /// + /// Retrieves all existing Power BI workspace collections in the specified + /// resource group. + /// /// /// Azure resource group /// @@ -169,40 +171,44 @@ public partial interface IWorkspaceCollectionsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Retrieves all existing Power BI workspace collections in the - /// specified subscription. + /// Retrieves all existing Power BI workspace collections in the specified + /// subscription. /// + /// + /// Retrieves all existing Power BI workspace collections in the specified + /// subscription. + /// /// /// The headers that will be added to request. /// /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListBySubscriptionWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListBySubscriptionWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Retrieves the primary and secondary access keys for the specified - /// Power BI Workspace Collection. + /// Retrieves the primary and secondary access keys for the specified Power BI + /// Workspace Collection. /// + /// + /// Retrieves the primary and secondary access keys for the specified Power BI + /// Workspace Collection. + /// /// /// Azure resource group /// @@ -215,20 +221,22 @@ public partial interface IWorkspaceCollectionsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetAccessKeysWithHttpMessagesAsync(string resourceGroupName, string workspaceCollectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetAccessKeysWithHttpMessagesAsync(string resourceGroupName, string workspaceCollectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Regenerates the primary or secondary access key for the specified - /// Power BI Workspace Collection. + /// Regenerates the primary or secondary access key for the specified Power BI + /// Workspace Collection. /// + /// + /// Regenerates the primary or secondary access key for the specified Power BI + /// Workspace Collection. + /// /// /// Azure resource group /// @@ -244,20 +252,22 @@ public partial interface IWorkspaceCollectionsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> RegenerateKeyWithHttpMessagesAsync(string resourceGroupName, string workspaceCollectionName, WorkspaceCollectionAccessKey body, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> RegenerateKeyWithHttpMessagesAsync(string resourceGroupName, string workspaceCollectionName, WorkspaceCollectionAccessKey body, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Migrates an existing Power BI Workspace Collection to a different - /// resource group and/or subscription. + /// Migrates an existing Power BI Workspace Collection to a different resource + /// group and/or subscription. /// + /// + /// Migrates an existing Power BI Workspace Collection to a different resource + /// group and/or subscription. + /// /// /// Azure resource group /// @@ -270,16 +280,17 @@ public partial interface IWorkspaceCollectionsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task MigrateWithHttpMessagesAsync(string resourceGroupName, MigrateWorkspaceCollectionRequest body, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task MigrateWithHttpMessagesAsync(string resourceGroupName, MigrateWorkspaceCollectionRequest body, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Delete a Power BI Workspace Collection. /// + /// + /// Delete a Power BI Workspace Collection. + /// /// /// Azure resource group /// @@ -292,12 +303,10 @@ public partial interface IWorkspaceCollectionsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string workspaceCollectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string workspaceCollectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/IWorkspacesOperations.cs b/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/IWorkspacesOperations.cs index 6897d92f3f26..c0c099869947 100644 --- a/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/IWorkspacesOperations.cs +++ b/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/IWorkspacesOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.PowerBIEmbedded { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// WorkspacesOperations operations. @@ -24,9 +14,13 @@ namespace Microsoft.Azure.Management.PowerBIEmbedded public partial interface IWorkspacesOperations { /// - /// Retrieves all existing Power BI workspaces in the specified - /// workspace collection. + /// Retrieves all existing Power BI workspaces in the specified workspace + /// collection. /// + /// + /// Retrieves all existing Power BI workspaces in the specified workspace + /// collection. + /// /// /// Azure resource group /// @@ -39,15 +33,13 @@ public partial interface IWorkspacesOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(string resourceGroupName, string workspaceCollectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string workspaceCollectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/Models/AccessKeyName.cs b/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/Models/AccessKeyName.cs index e868aa371340..3151fed94bca 100644 --- a/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/Models/AccessKeyName.cs +++ b/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/Models/AccessKeyName.cs @@ -1,29 +1,22 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.PowerBIEmbedded.Models { - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime; - using System.Runtime.Serialization; /// /// Defines values for AccessKeyName. /// - [JsonConverter(typeof(StringEnumConverter))] + + + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] public enum AccessKeyName { - [EnumMember(Value = "key1")] + [System.Runtime.Serialization.EnumMember(Value = "key1")] Key1, - [EnumMember(Value = "key2")] + [System.Runtime.Serialization.EnumMember(Value = "key2")] Key2 } internal static class AccessKeyNameEnumExtension @@ -32,7 +25,6 @@ internal static string ToSerializedValue(this AccessKeyName? value) { return value == null ? null : ((AccessKeyName)value).ToSerializedValue(); } - internal static string ToSerializedValue(this AccessKeyName value) { switch( value ) @@ -44,7 +36,6 @@ internal static string ToSerializedValue(this AccessKeyName value) } return null; } - internal static AccessKeyName? ParseAccessKeyName(this string value) { switch( value ) @@ -57,4 +48,4 @@ internal static string ToSerializedValue(this AccessKeyName value) return null; } } -} +} \ No newline at end of file diff --git a/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/Models/AzureSku.cs b/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/Models/AzureSku.cs index 59e9be22186d..5ad3acdc381d 100644 --- a/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/Models/AzureSku.cs +++ b/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/Models/AzureSku.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.PowerBIEmbedded.Models { - using Newtonsoft.Json; using System.Linq; public partial class AzureSku @@ -23,31 +17,11 @@ public AzureSku() CustomInit(); } - /// - /// Static constructor for AzureSku class. - /// - static AzureSku() - { - Name = "S1"; - Tier = "Standard"; - } /// /// An initialization method that performs custom operations like setting defaults /// partial void CustomInit(); - /// - /// SKU name - /// - [JsonProperty(PropertyName = "name")] - public static string Name { get; private set; } - - /// - /// SKU tier - /// - [JsonProperty(PropertyName = "tier")] - public static string Tier { get; private set; } - } -} +} \ No newline at end of file diff --git a/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/Models/AzureSkuName.cs b/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/Models/AzureSkuName.cs new file mode 100644 index 000000000000..fe6827ff56e7 --- /dev/null +++ b/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/Models/AzureSkuName.cs @@ -0,0 +1,18 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.PowerBIEmbedded.Models +{ + + /// + /// Defines values for AzureSkuName. + /// + + + public static class AzureSkuName + { + public const string S1 = "S1"; + } +} \ No newline at end of file diff --git a/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/Models/AzureSkuTier.cs b/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/Models/AzureSkuTier.cs new file mode 100644 index 000000000000..7fbafbf5348b --- /dev/null +++ b/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/Models/AzureSkuTier.cs @@ -0,0 +1,18 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.PowerBIEmbedded.Models +{ + + /// + /// Defines values for AzureSkuTier. + /// + + + public static class AzureSkuTier + { + public const string Standard = "Standard"; + } +} \ No newline at end of file diff --git a/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/Models/CheckNameReason.cs b/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/Models/CheckNameReason.cs index de90e8ad35cc..012c755c3c92 100644 --- a/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/Models/CheckNameReason.cs +++ b/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/Models/CheckNameReason.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.PowerBIEmbedded.Models { @@ -14,9 +9,11 @@ namespace Microsoft.Azure.Management.PowerBIEmbedded.Models /// /// Defines values for CheckNameReason. /// + + public static class CheckNameReason { public const string Unavailable = "Unavailable"; public const string Invalid = "Invalid"; } -} +} \ No newline at end of file diff --git a/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/Models/CheckNameRequest.cs b/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/Models/CheckNameRequest.cs index 3ad0ca2caf2b..029b3ed0e38d 100644 --- a/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/Models/CheckNameRequest.cs +++ b/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/Models/CheckNameRequest.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.PowerBIEmbedded.Models { - using Newtonsoft.Json; using System.Linq; public partial class CheckNameRequest @@ -26,12 +20,17 @@ public CheckNameRequest() /// /// Initializes a new instance of the CheckNameRequest class. /// - /// Workspace collection name - /// Resource type + + /// Workspace collection name + /// + + /// Resource type + /// public CheckNameRequest(string name = default(string), string type = default(string)) + { - Name = name; - Type = type; + this.Name = name; + this.Type = type; CustomInit(); } @@ -40,17 +39,17 @@ public CheckNameRequest() /// partial void CustomInit(); + /// /// Gets or sets workspace collection name /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// /// Gets or sets resource type /// - [JsonProperty(PropertyName = "type")] - public string Type { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; set; } } -} +} \ No newline at end of file diff --git a/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/Models/CheckNameResponse.cs b/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/Models/CheckNameResponse.cs index f8462196e1e7..cf3e4f1e7657 100644 --- a/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/Models/CheckNameResponse.cs +++ b/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/Models/CheckNameResponse.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.PowerBIEmbedded.Models { - using Newtonsoft.Json; using System.Linq; public partial class CheckNameResponse @@ -26,20 +20,23 @@ public CheckNameResponse() /// /// Initializes a new instance of the CheckNameResponse class. /// - /// Specifies a Boolean value that - /// indicates whether the specified Power BI Workspace Collection name - /// is available to use. - /// Reason why the workspace collection name - /// cannot be used. Possible values include: 'Unavailable', - /// 'Invalid' - /// Message indicating an unavailable name due to - /// a conflict, or a description of the naming rules that are - /// violated. + + /// Specifies a Boolean value that indicates whether the specified Power BI + /// Workspace Collection name is available to use. + /// + + /// Reason why the workspace collection name cannot be used. + /// Possible values include: 'Unavailable', 'Invalid' + + /// Message indicating an unavailable name due to a conflict, or a description + /// of the naming rules that are violated. + /// public CheckNameResponse(bool? nameAvailable = default(bool?), string reason = default(string), string message = default(string)) + { - NameAvailable = nameAvailable; - Reason = reason; - Message = message; + this.NameAvailable = nameAvailable; + this.Reason = reason; + this.Message = message; CustomInit(); } @@ -48,26 +45,25 @@ public CheckNameResponse() /// partial void CustomInit(); + /// - /// Gets or sets specifies a Boolean value that indicates whether the - /// specified Power BI Workspace Collection name is available to use. + /// Gets or sets specifies a Boolean value that indicates whether the specified + /// Power BI Workspace Collection name is available to use. /// - [JsonProperty(PropertyName = "nameAvailable")] - public bool? NameAvailable { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "nameAvailable")] + public bool? NameAvailable {get; set; } /// - /// Gets or sets reason why the workspace collection name cannot be - /// used. Possible values include: 'Unavailable', 'Invalid' + /// Gets or sets reason why the workspace collection name cannot be used. Possible values include: 'Unavailable', 'Invalid' /// - [JsonProperty(PropertyName = "reason")] - public string Reason { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "reason")] + public string Reason {get; set; } /// - /// Gets or sets message indicating an unavailable name due to a - /// conflict, or a description of the naming rules that are violated. + /// Gets or sets message indicating an unavailable name due to a conflict, or a + /// description of the naming rules that are violated. /// - [JsonProperty(PropertyName = "message")] - public string Message { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "message")] + public string Message {get; set; } } -} +} \ No newline at end of file diff --git a/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/Models/CreateWorkspaceCollectionRequest.cs b/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/Models/CreateWorkspaceCollectionRequest.cs index e18f2a08445c..382cb6277748 100644 --- a/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/Models/CreateWorkspaceCollectionRequest.cs +++ b/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/Models/CreateWorkspaceCollectionRequest.cs @@ -1,25 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.PowerBIEmbedded.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; public partial class CreateWorkspaceCollectionRequest { /// - /// Initializes a new instance of the CreateWorkspaceCollectionRequest - /// class. + /// Initializes a new instance of the CreateWorkspaceCollectionRequest class. /// public CreateWorkspaceCollectionRequest() { @@ -27,44 +18,48 @@ public CreateWorkspaceCollectionRequest() } /// - /// Initializes a new instance of the CreateWorkspaceCollectionRequest - /// class. + /// Initializes a new instance of the CreateWorkspaceCollectionRequest class. /// - /// Azure location - public CreateWorkspaceCollectionRequest(string location = default(string), IDictionary tags = default(IDictionary)) + + /// Azure location + /// + + /// Dictionary of <string> + /// + + /// + /// + public CreateWorkspaceCollectionRequest(string location = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), AzureSku sku = default(AzureSku)) + { - Location = location; - Tags = tags; + this.Location = location; + this.Tags = tags; + this.Sku = sku; CustomInit(); } - /// - /// Static constructor for CreateWorkspaceCollectionRequest class. - /// - static CreateWorkspaceCollectionRequest() - { - Sku = new AzureSku(); - } /// /// An initialization method that performs custom operations like setting defaults /// partial void CustomInit(); + /// /// Gets or sets azure location /// - [JsonProperty(PropertyName = "location")] - public string Location { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "location")] + public string Location {get; set; } /// + /// Gets or sets dictionary of <string> /// - [JsonProperty(PropertyName = "tags")] - public IDictionary Tags { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "tags")] + public System.Collections.Generic.IDictionary Tags {get; set; } /// + /// Gets or sets /// - [JsonProperty(PropertyName = "sku")] - public static AzureSku Sku { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "sku")] + public AzureSku Sku {get; set; } } -} +} \ No newline at end of file diff --git a/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/Models/Display.cs b/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/Models/Display.cs index 84d8ed6509eb..d43317519456 100644 --- a/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/Models/Display.cs +++ b/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/Models/Display.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.PowerBIEmbedded.Models { - using Newtonsoft.Json; using System.Linq; public partial class Display @@ -26,32 +20,41 @@ public Display() /// /// Initializes a new instance of the Display class. /// - /// The localized friendly form of the resource - /// provider name. This form is also expected to include the - /// publisher/company responsible. Use Title Casing. Begin with - /// “Microsoft” for 1st party services. - /// The localized friendly form of the resource - /// type related to this action/operation. This form should match the - /// public documentation for the resource provider. Use Title Casing. - /// For examples, refer to the “name” section. - /// The localized friendly name for the - /// operation as shown to the user. This name should be concise (to fit - /// in drop downs), but clear (self-documenting). Use Title Casing and - /// include the entity/resource to which it applies. - /// The localized friendly description for - /// the operation as shown to the user. This description should be - /// thorough, yet concise. It will be used in tool-tips and detailed - /// views. - /// The intended executor of the operation; - /// governs the display of the operation in the RBAC UX and the audit - /// logs UX. Default value is 'user,system' + + /// The localized friendly form of the resource provider name. This form is + /// also expected to include the publisher/company responsible. Use Title + /// Casing. Begin with “Microsoft” for 1st party services. + /// + + /// The localized friendly form of the resource type related to this + /// action/operation. This form should match the public documentation for the + /// resource provider. Use Title Casing. For examples, refer to the “name” + /// section. + /// + + /// The localized friendly name for the operation as shown to the user. This + /// name should be concise (to fit in drop downs), but clear + /// (self-documenting). Use Title Casing and include the entity/resource to + /// which it applies. + /// + + /// The localized friendly description for the operation as shown to the user. + /// This description should be thorough, yet concise. It will be used in + /// tool-tips and detailed views. + /// + + /// The intended executor of the operation; governs the display of the + /// operation in the RBAC UX and the audit logs UX. Default value is + /// 'user,system' + /// public Display(string provider = default(string), string resource = default(string), string operation = default(string), string description = default(string), string origin = default(string)) + { - Provider = provider; - Resource = resource; - Operation = operation; - Description = description; - Origin = origin; + this.Provider = provider; + this.Resource = resource; + this.Operation = operation; + this.Description = description; + this.Origin = origin; CustomInit(); } @@ -60,48 +63,47 @@ public Display() /// partial void CustomInit(); + /// - /// Gets or sets the localized friendly form of the resource provider - /// name. This form is also expected to include the publisher/company - /// responsible. Use Title Casing. Begin with “Microsoft” for 1st party - /// services. + /// Gets or sets the localized friendly form of the resource provider name. + /// This form is also expected to include the publisher/company responsible. + /// Use Title Casing. Begin with “Microsoft” for 1st party services. /// - [JsonProperty(PropertyName = "provider")] - public string Provider { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "provider")] + public string Provider {get; set; } /// - /// Gets or sets the localized friendly form of the resource type - /// related to this action/operation. This form should match the public - /// documentation for the resource provider. Use Title Casing. For - /// examples, refer to the “name” section. + /// Gets or sets the localized friendly form of the resource type related to + /// this action/operation. This form should match the public documentation for + /// the resource provider. Use Title Casing. For examples, refer to the “name” + /// section. /// - [JsonProperty(PropertyName = "resource")] - public string Resource { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "resource")] + public string Resource {get; set; } /// - /// Gets or sets the localized friendly name for the operation as shown - /// to the user. This name should be concise (to fit in drop downs), - /// but clear (self-documenting). Use Title Casing and include the - /// entity/resource to which it applies. + /// Gets or sets the localized friendly name for the operation as shown to the + /// user. This name should be concise (to fit in drop downs), but clear + /// (self-documenting). Use Title Casing and include the entity/resource to + /// which it applies. /// - [JsonProperty(PropertyName = "operation")] - public string Operation { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "operation")] + public string Operation {get; set; } /// - /// Gets or sets the localized friendly description for the operation - /// as shown to the user. This description should be thorough, yet - /// concise. It will be used in tool-tips and detailed views. + /// Gets or sets the localized friendly description for the operation as shown + /// to the user. This description should be thorough, yet concise. It will be + /// used in tool-tips and detailed views. /// - [JsonProperty(PropertyName = "description")] - public string Description { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "description")] + public string Description {get; set; } /// - /// Gets or sets the intended executor of the operation; governs the - /// display of the operation in the RBAC UX and the audit logs UX. - /// Default value is 'user,system' + /// Gets or sets the intended executor of the operation; governs the display of + /// the operation in the RBAC UX and the audit logs UX. Default value is + /// 'user,system' /// - [JsonProperty(PropertyName = "origin")] - public string Origin { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "origin")] + public string Origin {get; set; } } -} +} \ No newline at end of file diff --git a/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/Models/Error.cs b/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/Models/Error.cs index a75610e53b8c..d46603a17b1f 100644 --- a/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/Models/Error.cs +++ b/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/Models/Error.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.PowerBIEmbedded.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; public partial class Error @@ -28,12 +20,25 @@ public Error() /// /// Initializes a new instance of the Error class. /// - public Error(string code = default(string), string message = default(string), string target = default(string), IList details = default(IList)) + + /// + /// + + /// + /// + + /// + /// + + /// + /// + public Error(string code = default(string), string message = default(string), string target = default(string), System.Collections.Generic.IList details = default(System.Collections.Generic.IList)) + { - Code = code; - Message = message; - Target = target; - Details = details; + this.Code = code; + this.Message = message; + this.Target = target; + this.Details = details; CustomInit(); } @@ -42,25 +47,29 @@ public Error() /// partial void CustomInit(); + /// + /// Gets or sets /// - [JsonProperty(PropertyName = "code")] - public string Code { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "code")] + public string Code {get; set; } /// + /// Gets or sets /// - [JsonProperty(PropertyName = "message")] - public string Message { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "message")] + public string Message {get; set; } /// + /// Gets or sets /// - [JsonProperty(PropertyName = "target")] - public string Target { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "target")] + public string Target {get; set; } /// + /// Gets or sets /// - [JsonProperty(PropertyName = "details")] - public IList Details { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "details")] + public System.Collections.Generic.IList Details {get; set; } } -} +} \ No newline at end of file diff --git a/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/Models/ErrorDetail.cs b/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/Models/ErrorDetail.cs index 900da4785aad..d1fef3478878 100644 --- a/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/Models/ErrorDetail.cs +++ b/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/Models/ErrorDetail.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.PowerBIEmbedded.Models { - using Newtonsoft.Json; using System.Linq; public partial class ErrorDetail @@ -26,11 +20,21 @@ public ErrorDetail() /// /// Initializes a new instance of the ErrorDetail class. /// + + /// + /// + + /// + /// + + /// + /// public ErrorDetail(string code = default(string), string message = default(string), string target = default(string)) + { - Code = code; - Message = message; - Target = target; + this.Code = code; + this.Message = message; + this.Target = target; CustomInit(); } @@ -39,20 +43,23 @@ public ErrorDetail() /// partial void CustomInit(); + /// + /// Gets or sets /// - [JsonProperty(PropertyName = "code")] - public string Code { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "code")] + public string Code {get; set; } /// + /// Gets or sets /// - [JsonProperty(PropertyName = "message")] - public string Message { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "message")] + public string Message {get; set; } /// + /// Gets or sets /// - [JsonProperty(PropertyName = "target")] - public string Target { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "target")] + public string Target {get; set; } } -} +} \ No newline at end of file diff --git a/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/Models/ErrorException.cs b/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/Models/ErrorException.cs index ecee4d11f2d2..efcbf60df5f0 100644 --- a/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/Models/ErrorException.cs +++ b/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/Models/ErrorException.cs @@ -1,31 +1,25 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.PowerBIEmbedded.Models { - using Microsoft.Rest; /// /// Exception thrown for an invalid response with Error information. /// - public partial class ErrorException : RestException + public partial class ErrorException : Microsoft.Rest.RestException { /// /// Gets information about the associated HTTP request. /// - public HttpRequestMessageWrapper Request { get; set; } + public Microsoft.Rest.HttpRequestMessageWrapper Request { get; set; } /// /// Gets information about the associated HTTP response. /// - public HttpResponseMessageWrapper Response { get; set; } + public Microsoft.Rest.HttpResponseMessageWrapper Response { get; set; } /// /// Gets or sets the body object. @@ -40,7 +34,7 @@ public ErrorException() } /// - /// Initializes a new instance of the ErrorException class. + /// Initializes a new instance of the Error class. /// /// The exception message. public ErrorException(string message) @@ -49,7 +43,7 @@ public ErrorException(string message) } /// - /// Initializes a new instance of the ErrorException class. + /// Initializes a new instance of the Error class. /// /// The exception message. /// Inner exception. @@ -58,4 +52,4 @@ public ErrorException(string message, System.Exception innerException) { } } -} +} \ No newline at end of file diff --git a/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/Models/MigrateWorkspaceCollectionRequest.cs b/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/Models/MigrateWorkspaceCollectionRequest.cs index 5e7bb354d420..0ab4eb90b2a7 100644 --- a/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/Models/MigrateWorkspaceCollectionRequest.cs +++ b/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/Models/MigrateWorkspaceCollectionRequest.cs @@ -1,25 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.PowerBIEmbedded.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; public partial class MigrateWorkspaceCollectionRequest { /// - /// Initializes a new instance of the MigrateWorkspaceCollectionRequest - /// class. + /// Initializes a new instance of the MigrateWorkspaceCollectionRequest class. /// public MigrateWorkspaceCollectionRequest() { @@ -27,15 +18,20 @@ public MigrateWorkspaceCollectionRequest() } /// - /// Initializes a new instance of the MigrateWorkspaceCollectionRequest - /// class. + /// Initializes a new instance of the MigrateWorkspaceCollectionRequest class. /// - /// Name of the resource group the - /// Power BI workspace collections will be migrated to. - public MigrateWorkspaceCollectionRequest(string targetResourceGroup = default(string), IList resources = default(IList)) + + /// Name of the resource group the Power BI workspace collections will be + /// migrated to. + /// + + /// + /// + public MigrateWorkspaceCollectionRequest(string targetResourceGroup = default(string), System.Collections.Generic.IList resources = default(System.Collections.Generic.IList)) + { - TargetResourceGroup = targetResourceGroup; - Resources = resources; + this.TargetResourceGroup = targetResourceGroup; + this.Resources = resources; CustomInit(); } @@ -44,17 +40,18 @@ public MigrateWorkspaceCollectionRequest() /// partial void CustomInit(); + /// - /// Gets or sets name of the resource group the Power BI workspace - /// collections will be migrated to. + /// Gets or sets name of the resource group the Power BI workspace collections + /// will be migrated to. /// - [JsonProperty(PropertyName = "targetResourceGroup")] - public string TargetResourceGroup { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "targetResourceGroup")] + public string TargetResourceGroup {get; set; } /// + /// Gets or sets /// - [JsonProperty(PropertyName = "resources")] - public IList Resources { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "resources")] + public System.Collections.Generic.IList Resources {get; set; } } -} +} \ No newline at end of file diff --git a/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/Models/Operation.cs b/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/Models/Operation.cs index f756d5ca6864..b876dee4bf13 100644 --- a/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/Models/Operation.cs +++ b/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/Models/Operation.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.PowerBIEmbedded.Models { - using Newtonsoft.Json; using System.Linq; public partial class Operation @@ -26,13 +20,18 @@ public Operation() /// /// Initializes a new instance of the Operation class. /// - /// The name of the operation being performed on - /// this particular object. This name should match the action name that - /// appears in RBAC / the event service. + + /// The name of the operation being performed on this particular object. This + /// name should match the action name that appears in RBAC / the event service. + /// + + /// + /// public Operation(string name = default(string), Display display = default(Display)) + { - Name = name; - Display = display; + this.Name = name; + this.Display = display; CustomInit(); } @@ -41,18 +40,19 @@ public Operation() /// partial void CustomInit(); + /// - /// Gets or sets the name of the operation being performed on this - /// particular object. This name should match the action name that - /// appears in RBAC / the event service. + /// Gets or sets the name of the operation being performed on this particular + /// object. This name should match the action name that appears in RBAC / the + /// event service. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// + /// Gets or sets /// - [JsonProperty(PropertyName = "display")] - public Display Display { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "display")] + public Display Display {get; set; } } -} +} \ No newline at end of file diff --git a/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/Models/OperationList.cs b/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/Models/OperationList.cs index 55a7e24189c3..f4ea44ba7904 100644 --- a/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/Models/OperationList.cs +++ b/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/Models/OperationList.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.PowerBIEmbedded.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; public partial class OperationList @@ -28,9 +20,13 @@ public OperationList() /// /// Initializes a new instance of the OperationList class. /// - public OperationList(IList value = default(IList)) + + /// + /// + public OperationList(System.Collections.Generic.IList value = default(System.Collections.Generic.IList)) + { - Value = value; + this.Value = value; CustomInit(); } @@ -39,10 +35,11 @@ public OperationList() /// partial void CustomInit(); + /// + /// Gets or sets /// - [JsonProperty(PropertyName = "value")] - public IList Value { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "value")] + public System.Collections.Generic.IList Value {get; set; } } -} +} \ No newline at end of file diff --git a/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/Models/Page.cs b/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/Models/Page.cs index 5e98d8e07b79..7df0e73520e6 100644 --- a/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/Models/Page.cs +++ b/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/Models/Page.cs @@ -1,53 +1,43 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + namespace Microsoft.Azure.Management.PowerBIEmbedded.Models { - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; /// /// Defines a page in Azure responses. /// /// Type of the page content items - [JsonObject] - public class Page : IPage + [Newtonsoft.Json.JsonObject] + public class Page : Microsoft.Rest.Azure.IPage { - /// - /// Gets the link to the next page. - /// - [JsonProperty("")] - public string NextPageLink { get; private set; } - - [JsonProperty("value")] - private IList Items{ get; set; } - - /// - /// Returns an enumerator that iterates through the collection. - /// - /// A an enumerator that can be used to iterate through the collection. - public IEnumerator GetEnumerator() - { - return Items == null ? System.Linq.Enumerable.Empty().GetEnumerator() : Items.GetEnumerator(); - } - - /// - /// Returns an enumerator that iterates through the collection. - /// - /// A an enumerator that can be used to iterate through the collection. - IEnumerator IEnumerable.GetEnumerator() - { - return GetEnumerator(); - } + /// + /// Gets the link to the next page. + /// + [Newtonsoft.Json.JsonProperty("")] + public System.String NextPageLink { get; private set; } + + [Newtonsoft.Json.JsonProperty("value")] + private System.Collections.Generic.IList Items{ get; set; } + + /// + /// Returns an enumerator that iterates through the collection. + /// + /// A an enumerator that can be used to iterate through the collection. + public System.Collections.Generic.IEnumerator GetEnumerator() + { + return (Items == null) ? System.Linq.Enumerable.Empty().GetEnumerator() : Items.GetEnumerator(); + } + + /// + /// Returns an enumerator that iterates through the collection. + /// + /// A an enumerator that can be used to iterate through the collection. + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } } -} +} \ No newline at end of file diff --git a/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/Models/UpdateWorkspaceCollectionRequest.cs b/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/Models/UpdateWorkspaceCollectionRequest.cs index 0b626b3d44af..7c7a8c49ff61 100644 --- a/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/Models/UpdateWorkspaceCollectionRequest.cs +++ b/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/Models/UpdateWorkspaceCollectionRequest.cs @@ -1,25 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.PowerBIEmbedded.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; public partial class UpdateWorkspaceCollectionRequest { /// - /// Initializes a new instance of the UpdateWorkspaceCollectionRequest - /// class. + /// Initializes a new instance of the UpdateWorkspaceCollectionRequest class. /// public UpdateWorkspaceCollectionRequest() { @@ -27,36 +18,38 @@ public UpdateWorkspaceCollectionRequest() } /// - /// Initializes a new instance of the UpdateWorkspaceCollectionRequest - /// class. + /// Initializes a new instance of the UpdateWorkspaceCollectionRequest class. /// - public UpdateWorkspaceCollectionRequest(IDictionary tags = default(IDictionary)) + + /// Dictionary of <string> + /// + + /// + /// + public UpdateWorkspaceCollectionRequest(System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), AzureSku sku = default(AzureSku)) + { - Tags = tags; + this.Tags = tags; + this.Sku = sku; CustomInit(); } - /// - /// Static constructor for UpdateWorkspaceCollectionRequest class. - /// - static UpdateWorkspaceCollectionRequest() - { - Sku = new AzureSku(); - } /// /// An initialization method that performs custom operations like setting defaults /// partial void CustomInit(); + /// + /// Gets or sets dictionary of <string> /// - [JsonProperty(PropertyName = "tags")] - public IDictionary Tags { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "tags")] + public System.Collections.Generic.IDictionary Tags {get; set; } /// + /// Gets or sets /// - [JsonProperty(PropertyName = "sku")] - public static AzureSku Sku { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "sku")] + public AzureSku Sku {get; set; } } -} +} \ No newline at end of file diff --git a/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/Models/Workspace.cs b/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/Models/Workspace.cs index 69d892d5c621..ff8b6446a3e5 100644 --- a/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/Models/Workspace.cs +++ b/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/Models/Workspace.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.PowerBIEmbedded.Models { - using Newtonsoft.Json; using System.Linq; public partial class Workspace @@ -26,16 +20,25 @@ public Workspace() /// /// Initializes a new instance of the Workspace class. /// - /// Workspace id - /// Workspace name - /// Resource type - /// Property bag + + /// Workspace id + /// + + /// Workspace name + /// + + /// Resource type + /// + + /// Property bag + /// public Workspace(string id = default(string), string name = default(string), string type = default(string), object properties = default(object)) + { - Id = id; - Name = name; - Type = type; - Properties = properties; + this.Id = id; + this.Name = name; + this.Type = type; + this.Properties = properties; CustomInit(); } @@ -44,29 +47,29 @@ public Workspace() /// partial void CustomInit(); + /// /// Gets or sets workspace id /// - [JsonProperty(PropertyName = "id")] - public string Id { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "id")] + public string Id {get; set; } /// /// Gets or sets workspace name /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// /// Gets or sets resource type /// - [JsonProperty(PropertyName = "type")] - public string Type { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; set; } /// /// Gets or sets property bag /// - [JsonProperty(PropertyName = "properties")] - public object Properties { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties")] + public object Properties {get; set; } } -} +} \ No newline at end of file diff --git a/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/Models/WorkspaceCollection.cs b/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/Models/WorkspaceCollection.cs index 36049a5460b5..eb8f9f15042c 100644 --- a/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/Models/WorkspaceCollection.cs +++ b/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/Models/WorkspaceCollection.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.PowerBIEmbedded.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; public partial class WorkspaceCollection @@ -28,73 +20,86 @@ public WorkspaceCollection() /// /// Initializes a new instance of the WorkspaceCollection class. /// - /// Resource id - /// Workspace collection name - /// Resource type - /// Azure location - /// Properties - public WorkspaceCollection(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), object properties = default(object)) + + /// Resource id + /// + + /// Workspace collection name + /// + + /// Resource type + /// + + /// Azure location + /// + + /// Dictionary of <string> + /// + + /// + /// + + /// Properties + /// + public WorkspaceCollection(string id = default(string), string name = default(string), string type = default(string), string location = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), AzureSku sku = default(AzureSku), object properties = default(object)) + { - Id = id; - Name = name; - Type = type; - Location = location; - Tags = tags; - Properties = properties; + this.Id = id; + this.Name = name; + this.Type = type; + this.Location = location; + this.Tags = tags; + this.Sku = sku; + this.Properties = properties; CustomInit(); } - /// - /// Static constructor for WorkspaceCollection class. - /// - static WorkspaceCollection() - { - Sku = new AzureSku(); - } /// /// An initialization method that performs custom operations like setting defaults /// partial void CustomInit(); + /// /// Gets or sets resource id /// - [JsonProperty(PropertyName = "id")] - public string Id { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "id")] + public string Id {get; set; } /// /// Gets or sets workspace collection name /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// /// Gets or sets resource type /// - [JsonProperty(PropertyName = "type")] - public string Type { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; set; } /// /// Gets or sets azure location /// - [JsonProperty(PropertyName = "location")] - public string Location { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "location")] + public string Location {get; set; } /// + /// Gets or sets dictionary of <string> /// - [JsonProperty(PropertyName = "tags")] - public IDictionary Tags { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "tags")] + public System.Collections.Generic.IDictionary Tags {get; set; } /// - /// Gets or sets properties + /// Gets or sets /// - [JsonProperty(PropertyName = "properties")] - public object Properties { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "sku")] + public AzureSku Sku {get; set; } /// + /// Gets or sets properties /// - [JsonProperty(PropertyName = "sku")] - public static AzureSku Sku { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties")] + public object Properties {get; set; } } -} +} \ No newline at end of file diff --git a/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/Models/WorkspaceCollectionAccessKey.cs b/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/Models/WorkspaceCollectionAccessKey.cs index 36f014987777..871c150166a0 100644 --- a/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/Models/WorkspaceCollectionAccessKey.cs +++ b/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/Models/WorkspaceCollectionAccessKey.cs @@ -1,23 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.PowerBIEmbedded.Models { - using Newtonsoft.Json; using System.Linq; public partial class WorkspaceCollectionAccessKey { /// - /// Initializes a new instance of the WorkspaceCollectionAccessKey - /// class. + /// Initializes a new instance of the WorkspaceCollectionAccessKey class. /// public WorkspaceCollectionAccessKey() { @@ -25,14 +18,15 @@ public WorkspaceCollectionAccessKey() } /// - /// Initializes a new instance of the WorkspaceCollectionAccessKey - /// class. + /// Initializes a new instance of the WorkspaceCollectionAccessKey class. /// - /// Key name. Possible values include: 'key1', - /// 'key2' + + /// Key name + /// Possible values include: 'key1', 'key2' public WorkspaceCollectionAccessKey(AccessKeyName? keyName = default(AccessKeyName?)) + { - KeyName = keyName; + this.KeyName = keyName; CustomInit(); } @@ -41,11 +35,11 @@ public WorkspaceCollectionAccessKey() /// partial void CustomInit(); + /// - /// Gets or sets key name. Possible values include: 'key1', 'key2' + /// Gets or sets key name Possible values include: 'key1', 'key2' /// - [JsonProperty(PropertyName = "keyName")] - public AccessKeyName? KeyName { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "keyName")] + public AccessKeyName? KeyName {get; set; } } -} +} \ No newline at end of file diff --git a/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/Models/WorkspaceCollectionAccessKeys.cs b/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/Models/WorkspaceCollectionAccessKeys.cs index c09f5c26994e..b93a17ddb71c 100644 --- a/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/Models/WorkspaceCollectionAccessKeys.cs +++ b/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/Models/WorkspaceCollectionAccessKeys.cs @@ -1,23 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.PowerBIEmbedded.Models { - using Newtonsoft.Json; using System.Linq; public partial class WorkspaceCollectionAccessKeys { /// - /// Initializes a new instance of the WorkspaceCollectionAccessKeys - /// class. + /// Initializes a new instance of the WorkspaceCollectionAccessKeys class. /// public WorkspaceCollectionAccessKeys() { @@ -25,15 +18,19 @@ public WorkspaceCollectionAccessKeys() } /// - /// Initializes a new instance of the WorkspaceCollectionAccessKeys - /// class. + /// Initializes a new instance of the WorkspaceCollectionAccessKeys class. /// - /// Access key 1 - /// Access key 2 + + /// Access key 1 + /// + + /// Access key 2 + /// public WorkspaceCollectionAccessKeys(string key1 = default(string), string key2 = default(string)) + { - Key1 = key1; - Key2 = key2; + this.Key1 = key1; + this.Key2 = key2; CustomInit(); } @@ -42,17 +39,17 @@ public WorkspaceCollectionAccessKeys() /// partial void CustomInit(); + /// /// Gets or sets access key 1 /// - [JsonProperty(PropertyName = "key1")] - public string Key1 { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "key1")] + public string Key1 {get; set; } /// /// Gets or sets access key 2 /// - [JsonProperty(PropertyName = "key2")] - public string Key2 { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "key2")] + public string Key2 {get; set; } } -} +} \ No newline at end of file diff --git a/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/PowerBIEmbeddedManagementClient.cs b/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/PowerBIEmbeddedManagementClient.cs index daa745dcff0d..08a49524f79c 100644 --- a/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/PowerBIEmbeddedManagementClient.cs +++ b/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/PowerBIEmbeddedManagementClient.cs @@ -1,94 +1,76 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.PowerBIEmbedded { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; - using Microsoft.Rest.Serialization; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// - /// Client to manage your Power BI Embedded workspace collections and - /// retrieve workspaces. + /// Client to manage your Power BI Embedded workspace collections and retrieve + /// workspaces. /// - public partial class PowerBIEmbeddedManagementClient : ServiceClient, IPowerBIEmbeddedManagementClient, IAzureClient + public partial class PowerBIEmbeddedManagementClient : Microsoft.Rest.ServiceClient, IPowerBIEmbeddedManagementClient, IAzureClient { /// /// The base URI of the service. /// public System.Uri BaseUri { get; set; } - /// /// Gets or sets json serialization settings. /// - public JsonSerializerSettings SerializationSettings { get; private set; } - + public Newtonsoft.Json.JsonSerializerSettings SerializationSettings { get; private set; } /// /// Gets or sets json deserialization settings. /// - public JsonSerializerSettings DeserializationSettings { get; private set; } - + public Newtonsoft.Json.JsonSerializerSettings DeserializationSettings { get; private set; } /// /// Credentials needed for the client to connect to Azure. /// - public ServiceClientCredentials Credentials { get; private set; } + public Microsoft.Rest.ServiceClientCredentials Credentials { get; private set; } /// - /// Gets subscription credentials which uniquely identify a Microsoft Azure - /// subscription. The subscription ID forms part of the URI for every service - /// call. + /// The API version to use for this operation. /// - public string SubscriptionId { get; set; } + public string ApiVersion { get; private set; } /// - /// Client Api Version. + /// Gets subscription credentials which uniquely identify a Microsoft Azure + /// subscription. The subscription ID forms part of the URI for every service + /// call. /// - public string ApiVersion { get; private set; } + public string SubscriptionId { get; set;} /// /// The preferred language for the response. /// - public string AcceptLanguage { get; set; } + public string AcceptLanguage { get; set;} /// - /// The retry timeout in seconds for Long Running Operations. Default value is - /// 30. + /// The retry timeout in seconds for Long Running Operations. Default + /// /// value is 30. /// - public int? LongRunningOperationRetryTimeout { get; set; } + public int? LongRunningOperationRetryTimeout { get; set;} /// - /// Whether a unique x-ms-client-request-id should be generated. When set to - /// true a unique x-ms-client-request-id value is generated and included in - /// each request. Default is true. + /// Whether a unique x-ms-client-request-id should be generated. When + /// /// set to true a unique x-ms-client-request-id value is generated and + /// /// included in each request. Default is true. /// - public bool? GenerateClientRequestId { get; set; } + public bool? GenerateClientRequestId { get; set;} /// - /// Gets the IWorkspaceCollectionsOperations. + /// Gets the IWorkspaceCollectionsOperations /// public virtual IWorkspaceCollectionsOperations WorkspaceCollections { get; private set; } - /// - /// Gets the IWorkspacesOperations. + /// Gets the IWorkspacesOperations /// public virtual IWorkspacesOperations Workspaces { get; private set; } - /// /// Initializes a new instance of the PowerBIEmbeddedManagementClient class. /// @@ -97,24 +79,22 @@ public partial class PowerBIEmbeddedManagementClient : ServiceClient /// /// True: will dispose the provided httpClient on calling PowerBIEmbeddedManagementClient.Dispose(). False: will not dispose provided httpClient - protected PowerBIEmbeddedManagementClient(HttpClient httpClient, bool disposeHttpClient) : base(httpClient, disposeHttpClient) + protected PowerBIEmbeddedManagementClient(System.Net.Http.HttpClient httpClient, bool disposeHttpClient) : base(httpClient, disposeHttpClient) { - Initialize(); + this.Initialize(); } - /// /// Initializes a new instance of the PowerBIEmbeddedManagementClient class. /// /// /// Optional. The delegating handlers to add to the http client pipeline. /// - protected PowerBIEmbeddedManagementClient(params DelegatingHandler[] handlers) : base(handlers) + protected PowerBIEmbeddedManagementClient(params System.Net.Http.DelegatingHandler[] handlers) : base(handlers) { - Initialize(); + this.Initialize(); } - /// - /// Initializes a new instance of the PowerBIEmbeddedManagementClient class. + /// Initializes a new instance of the PowerBIEmbeddedManagementClient class. /// /// /// Optional. The http client handler used to handle http transport. @@ -122,11 +102,10 @@ protected PowerBIEmbeddedManagementClient(params DelegatingHandler[] handlers) : /// /// Optional. The delegating handlers to add to the http client pipeline. /// - protected PowerBIEmbeddedManagementClient(HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : base(rootHandler, handlers) + protected PowerBIEmbeddedManagementClient(System.Net.Http.HttpClientHandler rootHandler, params System.Net.Http.DelegatingHandler[] handlers) : base(rootHandler, handlers) { - Initialize(); + this.Initialize(); } - /// /// Initializes a new instance of the PowerBIEmbeddedManagementClient class. /// @@ -139,15 +118,14 @@ protected PowerBIEmbeddedManagementClient(HttpClientHandler rootHandler, params /// /// Thrown when a required parameter is null /// - protected PowerBIEmbeddedManagementClient(System.Uri baseUri, params DelegatingHandler[] handlers) : this(handlers) + protected PowerBIEmbeddedManagementClient(System.Uri baseUri, params System.Net.Http.DelegatingHandler[] handlers) : this(handlers) { if (baseUri == null) { throw new System.ArgumentNullException("baseUri"); } - BaseUri = baseUri; + this.BaseUri = baseUri; } - /// /// Initializes a new instance of the PowerBIEmbeddedManagementClient class. /// @@ -163,15 +141,15 @@ protected PowerBIEmbeddedManagementClient(System.Uri baseUri, params DelegatingH /// /// Thrown when a required parameter is null /// - protected PowerBIEmbeddedManagementClient(System.Uri baseUri, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers) + protected PowerBIEmbeddedManagementClient(System.Uri baseUri, System.Net.Http.HttpClientHandler rootHandler, params System.Net.Http.DelegatingHandler[] handlers) : this(rootHandler, handlers) { if (baseUri == null) { throw new System.ArgumentNullException("baseUri"); } - BaseUri = baseUri; + + this.BaseUri = baseUri; } - /// /// Initializes a new instance of the PowerBIEmbeddedManagementClient class. /// @@ -184,23 +162,23 @@ protected PowerBIEmbeddedManagementClient(System.Uri baseUri, HttpClientHandler /// /// Thrown when a required parameter is null /// - public PowerBIEmbeddedManagementClient(ServiceClientCredentials credentials, params DelegatingHandler[] handlers) : this(handlers) + public PowerBIEmbeddedManagementClient(Microsoft.Rest.ServiceClientCredentials credentials, params System.Net.Http.DelegatingHandler[] handlers) : this(handlers) { if (credentials == null) { throw new System.ArgumentNullException("credentials"); } - Credentials = credentials; - if (Credentials != null) + this.Credentials = credentials; + if (this.Credentials != null) { - Credentials.InitializeServiceClient(this); + this.Credentials.InitializeServiceClient(this); } + } - /// /// Initializes a new instance of the PowerBIEmbeddedManagementClient class. /// - /// + /// /// Required. Credentials needed for the client to connect to Azure. /// /// @@ -211,23 +189,23 @@ public PowerBIEmbeddedManagementClient(ServiceClientCredentials credentials, par /// /// Thrown when a required parameter is null /// - public PowerBIEmbeddedManagementClient(ServiceClientCredentials credentials, HttpClient httpClient, bool disposeHttpClient) : this(httpClient, disposeHttpClient) + public PowerBIEmbeddedManagementClient(Microsoft.Rest.ServiceClientCredentials credentials, System.Net.Http.HttpClient httpClient, bool disposeHttpClient) : this(httpClient, disposeHttpClient) { if (credentials == null) { throw new System.ArgumentNullException("credentials"); } - Credentials = credentials; - if (Credentials != null) + this.Credentials = credentials; + if (this.Credentials != null) { - Credentials.InitializeServiceClient(this); + this.Credentials.InitializeServiceClient(this); } + } - /// /// Initializes a new instance of the PowerBIEmbeddedManagementClient class. /// - /// + /// /// Required. Credentials needed for the client to connect to Azure. /// /// @@ -239,26 +217,26 @@ public PowerBIEmbeddedManagementClient(ServiceClientCredentials credentials, Htt /// /// Thrown when a required parameter is null /// - public PowerBIEmbeddedManagementClient(ServiceClientCredentials credentials, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers) + public PowerBIEmbeddedManagementClient(Microsoft.Rest.ServiceClientCredentials credentials, System.Net.Http.HttpClientHandler rootHandler, params System.Net.Http.DelegatingHandler[] handlers) : this(rootHandler, handlers) { if (credentials == null) { throw new System.ArgumentNullException("credentials"); } - Credentials = credentials; - if (Credentials != null) + this.Credentials = credentials; + if (this.Credentials != null) { - Credentials.InitializeServiceClient(this); + this.Credentials.InitializeServiceClient(this); } + } - /// /// Initializes a new instance of the PowerBIEmbeddedManagementClient class. /// /// /// Optional. The base URI of the service. /// - /// + /// /// Required. Credentials needed for the client to connect to Azure. /// /// @@ -267,7 +245,7 @@ public PowerBIEmbeddedManagementClient(ServiceClientCredentials credentials, Htt /// /// Thrown when a required parameter is null /// - public PowerBIEmbeddedManagementClient(System.Uri baseUri, ServiceClientCredentials credentials, params DelegatingHandler[] handlers) : this(handlers) + public PowerBIEmbeddedManagementClient(System.Uri baseUri, Microsoft.Rest.ServiceClientCredentials credentials, params System.Net.Http.DelegatingHandler[] handlers) : this(handlers) { if (baseUri == null) { @@ -277,33 +255,30 @@ public PowerBIEmbeddedManagementClient(System.Uri baseUri, ServiceClientCredenti { throw new System.ArgumentNullException("credentials"); } - BaseUri = baseUri; - Credentials = credentials; - if (Credentials != null) + this.BaseUri = baseUri; + this.Credentials = credentials; + if (this.Credentials != null) { - Credentials.InitializeServiceClient(this); + this.Credentials.InitializeServiceClient(this); } + } - /// /// Initializes a new instance of the PowerBIEmbeddedManagementClient class. /// /// /// Optional. The base URI of the service. /// - /// + /// /// Required. Credentials needed for the client to connect to Azure. /// /// /// Optional. The http client handler used to handle http transport. /// - /// - /// Optional. The delegating handlers to add to the http client pipeline. - /// /// /// Thrown when a required parameter is null /// - public PowerBIEmbeddedManagementClient(System.Uri baseUri, ServiceClientCredentials credentials, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers) + public PowerBIEmbeddedManagementClient(System.Uri baseUri, Microsoft.Rest.ServiceClientCredentials credentials, System.Net.Http.HttpClientHandler rootHandler, params System.Net.Http.DelegatingHandler[] handlers) : this(rootHandler, handlers) { if (baseUri == null) { @@ -313,57 +288,58 @@ public PowerBIEmbeddedManagementClient(System.Uri baseUri, ServiceClientCredenti { throw new System.ArgumentNullException("credentials"); } - BaseUri = baseUri; - Credentials = credentials; - if (Credentials != null) + this.BaseUri = baseUri; + this.Credentials = credentials; + if (this.Credentials != null) { - Credentials.InitializeServiceClient(this); + this.Credentials.InitializeServiceClient(this); } + } - /// /// An optional partial-method to perform custom initialization. /// partial void CustomInitialize(); + /// /// Initializes client properties. /// private void Initialize() { - WorkspaceCollections = new WorkspaceCollectionsOperations(this); - Workspaces = new WorkspacesOperations(this); - BaseUri = new System.Uri("https://management.azure.com"); - ApiVersion = "2016-01-29"; - AcceptLanguage = "en-US"; - LongRunningOperationRetryTimeout = 30; - GenerateClientRequestId = true; - SerializationSettings = new JsonSerializerSettings + this.WorkspaceCollections = new WorkspaceCollectionsOperations(this); + this.Workspaces = new WorkspacesOperations(this); + this.BaseUri = new System.Uri("https://management.azure.com"); + this.ApiVersion = "2016-01-29"; + this.AcceptLanguage = "en-US"; + this.LongRunningOperationRetryTimeout = 30; + this.GenerateClientRequestId = true; + SerializationSettings = new Newtonsoft.Json.JsonSerializerSettings { Formatting = Newtonsoft.Json.Formatting.Indented, DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat, DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore, ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize, - ContractResolver = new ReadOnlyJsonContractResolver(), - Converters = new List + ContractResolver = new Microsoft.Rest.Serialization.ReadOnlyJsonContractResolver(), + Converters = new System.Collections.Generic.List { - new Iso8601TimeSpanConverter() + new Microsoft.Rest.Serialization.Iso8601TimeSpanConverter() } }; - DeserializationSettings = new JsonSerializerSettings + DeserializationSettings = new Newtonsoft.Json.JsonSerializerSettings { DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat, DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore, ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize, - ContractResolver = new ReadOnlyJsonContractResolver(), - Converters = new List + ContractResolver = new Microsoft.Rest.Serialization.ReadOnlyJsonContractResolver(), + Converters = new System.Collections.Generic.List { - new Iso8601TimeSpanConverter() + new Microsoft.Rest.Serialization.Iso8601TimeSpanConverter() } }; CustomInitialize(); - DeserializationSettings.Converters.Add(new CloudErrorJsonConverter()); + DeserializationSettings.Converters.Add(new Microsoft.Rest.Azure.CloudErrorJsonConverter()); } /// /// Indicates which operations can be performed by the Power BI Resource @@ -375,13 +351,13 @@ private void Initialize() /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -390,54 +366,62 @@ private void Initialize() /// /// A response object containing the response body and response headers. /// - public async Task> GetAvailableOperationsWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetAvailableOperationsWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (ApiVersion == null) + + + + + if (this.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.ApiVersion"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.ApiVersion"); } + // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetAvailableOperations", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "GetAvailableOperations", tracingParameters); } // Construct URL - var _baseUrl = BaseUri.AbsoluteUri; + + var _baseUrl = this.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.PowerBI/operations").ToString(); - List _queryParameters = new List(); - if (ApiVersion != null) + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (this.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (GenerateClientRequestId != null && GenerateClientRequestId.Value) + if (this.GenerateClientRequestId != null && this.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (AcceptLanguage != null) + if (this.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -449,50 +433,51 @@ private void Initialize() _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Credentials != null) + if (this.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - Error _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, DeserializationSettings); + Error _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -502,9 +487,10 @@ private void Initialize() throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -515,24 +501,28 @@ private void Initialize() _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/PowerBIEmbeddedManagementClientExtensions.cs b/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/PowerBIEmbeddedManagementClientExtensions.cs index 2dcd4bf43f05..5d6836ebb5a8 100644 --- a/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/PowerBIEmbeddedManagementClientExtensions.cs +++ b/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/PowerBIEmbeddedManagementClientExtensions.cs @@ -1,55 +1,45 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.PowerBIEmbedded { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for PowerBIEmbeddedManagementClient. + /// Extension methods for PowerBIEmbeddedManagementClient /// public static partial class PowerBIEmbeddedManagementClientExtensions { - /// - /// Indicates which operations can be performed by the Power BI Resource - /// Provider. - /// - /// - /// The operations group for this extension method. - /// - public static OperationList GetAvailableOperations(this IPowerBIEmbeddedManagementClient operations) - { - return operations.GetAvailableOperationsAsync().GetAwaiter().GetResult(); - } + /// + /// Indicates which operations can be performed by the Power BI Resource + /// Provider. + /// + /// + /// The operations group for this extension method. + /// + public static OperationList GetAvailableOperations(this IPowerBIEmbeddedManagementClient operations) + { + return ((IPowerBIEmbeddedManagementClient)operations).GetAvailableOperationsAsync().GetAwaiter().GetResult(); + } - /// - /// Indicates which operations can be performed by the Power BI Resource - /// Provider. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The cancellation token. - /// - public static async Task GetAvailableOperationsAsync(this IPowerBIEmbeddedManagementClient operations, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Indicates which operations can be performed by the Power BI Resource + /// Provider. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAvailableOperationsAsync(this IPowerBIEmbeddedManagementClient operations, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetAvailableOperationsWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.GetAvailableOperationsWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } - + } } } diff --git a/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/SdkInfo_PowerBIEmbeddedManagementClient.cs b/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/SdkInfo_PowerBIEmbeddedManagementClient.cs deleted file mode 100644 index 980b459c99d6..000000000000 --- a/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/SdkInfo_PowerBIEmbeddedManagementClient.cs +++ /dev/null @@ -1,30 +0,0 @@ - -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.PowerBIEmbedded -{ - using System; - using System.Collections.Generic; - using System.Linq; - - internal static partial class SdkInfo - { - public static IEnumerable> ApiInfo_PowerBIEmbeddedManagementClient - { - get - { - return new Tuple[] - { - new Tuple("PowerBI", "WorkspaceCollections", "2016-01-29"), - new Tuple("PowerBI", "Workspaces", "2016-01-29"), - new Tuple("PowerBI", "getAvailableOperations", "2016-01-29"), - new Tuple("PowerBIEmbeddedManagementClient", "WorkspaceCollections", "2016-01-29"), - }.AsEnumerable(); - } - } - } -} diff --git a/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/WorkspaceCollectionsOperations.cs b/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/WorkspaceCollectionsOperations.cs index e39e9b1e4d76..aedbd4d7a661 100644 --- a/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/WorkspaceCollectionsOperations.cs +++ b/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/WorkspaceCollectionsOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.PowerBIEmbedded { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// WorkspaceCollectionsOperations operations. /// - internal partial class WorkspaceCollectionsOperations : IServiceOperations, IWorkspaceCollectionsOperations + internal partial class WorkspaceCollectionsOperations : Microsoft.Rest.IServiceOperations, IWorkspaceCollectionsOperations { /// /// Initializes a new instance of the WorkspaceCollectionsOperations class. @@ -36,13 +24,13 @@ internal partial class WorkspaceCollectionsOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal WorkspaceCollectionsOperations(PowerBIEmbeddedManagementClient client) + internal WorkspaceCollectionsOperations (PowerBIEmbeddedManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -65,13 +53,13 @@ internal WorkspaceCollectionsOperations(PowerBIEmbeddedManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -80,71 +68,82 @@ internal WorkspaceCollectionsOperations(PowerBIEmbeddedManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetByNameWithHttpMessagesAsync(string resourceGroupName, string workspaceCollectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetByNameWithHttpMessagesAsync(string resourceGroupName, string workspaceCollectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (workspaceCollectionName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "workspaceCollectionName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "workspaceCollectionName"); } - if (Client.ApiVersion == null) + + if (this.Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("workspaceCollectionName", workspaceCollectionName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetByName", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "GetByName", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBI/workspaceCollections/{workspaceCollectionName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{workspaceCollectionName}", System.Uri.EscapeDataString(workspaceCollectionName)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -156,50 +155,51 @@ internal WorkspaceCollectionsOperations(PowerBIEmbeddedManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - Error _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + Error _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -209,9 +209,10 @@ internal WorkspaceCollectionsOperations(PowerBIEmbeddedManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -222,25 +223,29 @@ internal WorkspaceCollectionsOperations(PowerBIEmbeddedManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Creates a new Power BI Workspace Collection with the specified properties. /// A Power BI Workspace Collection contains one or more workspaces, and can be @@ -261,13 +266,13 @@ internal WorkspaceCollectionsOperations(PowerBIEmbeddedManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -276,76 +281,88 @@ internal WorkspaceCollectionsOperations(PowerBIEmbeddedManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateWithHttpMessagesAsync(string resourceGroupName, string workspaceCollectionName, CreateWorkspaceCollectionRequest body, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateWithHttpMessagesAsync(string resourceGroupName, string workspaceCollectionName, CreateWorkspaceCollectionRequest body, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (body == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "body"); } - if (resourceGroupName == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (workspaceCollectionName == null) + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "workspaceCollectionName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - if (Client.ApiVersion == null) + + if (workspaceCollectionName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "workspaceCollectionName"); } - if (body == null) + + if (this.Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "body"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("workspaceCollectionName", workspaceCollectionName); + tracingParameters.Add("body", body); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Create", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Create", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBI/workspaceCollections/{workspaceCollectionName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{workspaceCollectionName}", System.Uri.EscapeDataString(workspaceCollectionName)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -357,56 +374,57 @@ internal WorkspaceCollectionsOperations(PowerBIEmbeddedManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(body != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(body, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(body, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - Error _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + Error _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -416,9 +434,10 @@ internal WorkspaceCollectionsOperations(PowerBIEmbeddedManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -429,25 +448,29 @@ internal WorkspaceCollectionsOperations(PowerBIEmbeddedManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Update an existing Power BI Workspace Collection with the specified /// properties. @@ -467,13 +490,13 @@ internal WorkspaceCollectionsOperations(PowerBIEmbeddedManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -482,76 +505,87 @@ internal WorkspaceCollectionsOperations(PowerBIEmbeddedManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceCollectionName, UpdateWorkspaceCollectionRequest body, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceCollectionName, UpdateWorkspaceCollectionRequest body, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (body == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "body"); } - if (resourceGroupName == null) + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (workspaceCollectionName == null) + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "workspaceCollectionName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - if (Client.ApiVersion == null) + + if (workspaceCollectionName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "workspaceCollectionName"); } - if (body == null) + + if (this.Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "body"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("workspaceCollectionName", workspaceCollectionName); + tracingParameters.Add("body", body); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Update", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Update", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBI/workspaceCollections/{workspaceCollectionName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{workspaceCollectionName}", System.Uri.EscapeDataString(workspaceCollectionName)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -563,56 +597,57 @@ internal WorkspaceCollectionsOperations(PowerBIEmbeddedManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(body != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(body, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(body, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - Error _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + Error _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -622,9 +657,10 @@ internal WorkspaceCollectionsOperations(PowerBIEmbeddedManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -635,25 +671,29 @@ internal WorkspaceCollectionsOperations(PowerBIEmbeddedManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Delete a Power BI Workspace Collection. /// @@ -664,16 +704,16 @@ internal WorkspaceCollectionsOperations(PowerBIEmbeddedManagementClient client) /// Power BI Embedded Workspace Collection name /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string workspaceCollectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string workspaceCollectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, workspaceCollectionName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, workspaceCollectionName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -692,13 +732,13 @@ internal WorkspaceCollectionsOperations(PowerBIEmbeddedManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -707,70 +747,81 @@ internal WorkspaceCollectionsOperations(PowerBIEmbeddedManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CheckNameAvailabilityWithHttpMessagesAsync(string location, CheckNameRequest body, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CheckNameAvailabilityWithHttpMessagesAsync(string location, CheckNameRequest body, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (body == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "body"); } - if (location == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "location"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (Client.ApiVersion == null) + + if (location == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "location"); } - if (body == null) + + if (this.Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "body"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("location", location); + tracingParameters.Add("body", body); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CheckNameAvailability", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "CheckNameAvailability", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.PowerBI/locations/{location}/checkNameAvailability").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{location}", System.Uri.EscapeDataString(location)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -782,56 +833,57 @@ internal WorkspaceCollectionsOperations(PowerBIEmbeddedManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(body != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(body, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(body, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - Error _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + Error _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -841,9 +893,10 @@ internal WorkspaceCollectionsOperations(PowerBIEmbeddedManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -854,25 +907,29 @@ internal WorkspaceCollectionsOperations(PowerBIEmbeddedManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Retrieves all existing Power BI workspace collections in the specified /// resource group. @@ -886,13 +943,13 @@ internal WorkspaceCollectionsOperations(PowerBIEmbeddedManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -901,65 +958,75 @@ internal WorkspaceCollectionsOperations(PowerBIEmbeddedManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - if (Client.ApiVersion == null) + + if (this.Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroup", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroup", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBI/workspaceCollections").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -971,50 +1038,51 @@ internal WorkspaceCollectionsOperations(PowerBIEmbeddedManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - Error _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + Error _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1024,9 +1092,10 @@ internal WorkspaceCollectionsOperations(PowerBIEmbeddedManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1037,25 +1106,29 @@ internal WorkspaceCollectionsOperations(PowerBIEmbeddedManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Retrieves all existing Power BI workspace collections in the specified /// subscription. @@ -1066,13 +1139,13 @@ internal WorkspaceCollectionsOperations(PowerBIEmbeddedManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1081,59 +1154,68 @@ internal WorkspaceCollectionsOperations(PowerBIEmbeddedManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListBySubscriptionWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListBySubscriptionWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (Client.ApiVersion == null) + + if (this.Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListBySubscription", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListBySubscription", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.PowerBI/workspaceCollections").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1145,50 +1227,51 @@ internal WorkspaceCollectionsOperations(PowerBIEmbeddedManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - Error _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + Error _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1198,9 +1281,10 @@ internal WorkspaceCollectionsOperations(PowerBIEmbeddedManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1211,25 +1295,29 @@ internal WorkspaceCollectionsOperations(PowerBIEmbeddedManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Retrieves the primary and secondary access keys for the specified Power BI /// Workspace Collection. @@ -1246,13 +1334,13 @@ internal WorkspaceCollectionsOperations(PowerBIEmbeddedManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1261,71 +1349,82 @@ internal WorkspaceCollectionsOperations(PowerBIEmbeddedManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetAccessKeysWithHttpMessagesAsync(string resourceGroupName, string workspaceCollectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetAccessKeysWithHttpMessagesAsync(string resourceGroupName, string workspaceCollectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (workspaceCollectionName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "workspaceCollectionName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "workspaceCollectionName"); } - if (Client.ApiVersion == null) + + if (this.Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("workspaceCollectionName", workspaceCollectionName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetAccessKeys", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "GetAccessKeys", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBI/workspaceCollections/{workspaceCollectionName}/listKeys").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{workspaceCollectionName}", System.Uri.EscapeDataString(workspaceCollectionName)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1337,50 +1436,51 @@ internal WorkspaceCollectionsOperations(PowerBIEmbeddedManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - Error _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + Error _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1390,9 +1490,10 @@ internal WorkspaceCollectionsOperations(PowerBIEmbeddedManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1403,25 +1504,29 @@ internal WorkspaceCollectionsOperations(PowerBIEmbeddedManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Regenerates the primary or secondary access key for the specified Power BI /// Workspace Collection. @@ -1441,13 +1546,13 @@ internal WorkspaceCollectionsOperations(PowerBIEmbeddedManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1456,76 +1561,88 @@ internal WorkspaceCollectionsOperations(PowerBIEmbeddedManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> RegenerateKeyWithHttpMessagesAsync(string resourceGroupName, string workspaceCollectionName, WorkspaceCollectionAccessKey body, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> RegenerateKeyWithHttpMessagesAsync(string resourceGroupName, string workspaceCollectionName, WorkspaceCollectionAccessKey body, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (body == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "body"); } - if (resourceGroupName == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (workspaceCollectionName == null) + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "workspaceCollectionName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - if (Client.ApiVersion == null) + + if (workspaceCollectionName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "workspaceCollectionName"); } - if (body == null) + + if (this.Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "body"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("workspaceCollectionName", workspaceCollectionName); + tracingParameters.Add("body", body); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "RegenerateKey", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "RegenerateKey", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBI/workspaceCollections/{workspaceCollectionName}/regenerateKey").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{workspaceCollectionName}", System.Uri.EscapeDataString(workspaceCollectionName)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1537,56 +1654,57 @@ internal WorkspaceCollectionsOperations(PowerBIEmbeddedManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(body != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(body, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(body, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - Error _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + Error _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1596,9 +1714,10 @@ internal WorkspaceCollectionsOperations(PowerBIEmbeddedManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1609,25 +1728,29 @@ internal WorkspaceCollectionsOperations(PowerBIEmbeddedManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Migrates an existing Power BI Workspace Collection to a different resource /// group and/or subscription. @@ -1644,10 +1767,10 @@ internal WorkspaceCollectionsOperations(PowerBIEmbeddedManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1656,70 +1779,81 @@ internal WorkspaceCollectionsOperations(PowerBIEmbeddedManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task MigrateWithHttpMessagesAsync(string resourceGroupName, MigrateWorkspaceCollectionRequest body, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task MigrateWithHttpMessagesAsync(string resourceGroupName, MigrateWorkspaceCollectionRequest body, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (body == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "body"); } - if (resourceGroupName == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (Client.ApiVersion == null) + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - if (body == null) + + if (this.Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "body"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("body", body); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Migrate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Migrate", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/moveResources").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1731,56 +1865,57 @@ internal WorkspaceCollectionsOperations(PowerBIEmbeddedManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(body != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(body, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(body, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - Error _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + Error _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1790,20 +1925,25 @@ internal WorkspaceCollectionsOperations(PowerBIEmbeddedManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Delete a Power BI Workspace Collection. /// @@ -1819,10 +1959,10 @@ internal WorkspaceCollectionsOperations(PowerBIEmbeddedManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1831,71 +1971,82 @@ internal WorkspaceCollectionsOperations(PowerBIEmbeddedManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string workspaceCollectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string workspaceCollectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (workspaceCollectionName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "workspaceCollectionName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "workspaceCollectionName"); } - if (Client.ApiVersion == null) + + if (this.Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("workspaceCollectionName", workspaceCollectionName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBI/workspaceCollections/{workspaceCollectionName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{workspaceCollectionName}", System.Uri.EscapeDataString(workspaceCollectionName)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1907,50 +2058,51 @@ internal WorkspaceCollectionsOperations(PowerBIEmbeddedManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 202) { var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - Error _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + Error _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1960,19 +2112,24 @@ internal WorkspaceCollectionsOperations(PowerBIEmbeddedManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/WorkspaceCollectionsOperationsExtensions.cs b/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/WorkspaceCollectionsOperationsExtensions.cs index dd1d9b917e86..d861a66342da 100644 --- a/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/WorkspaceCollectionsOperationsExtensions.cs +++ b/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/WorkspaceCollectionsOperationsExtensions.cs @@ -1,476 +1,424 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.PowerBIEmbedded { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for WorkspaceCollectionsOperations. + /// Extension methods for WorkspaceCollectionsOperations /// public static partial class WorkspaceCollectionsOperationsExtensions { - /// - /// Retrieves an existing Power BI Workspace Collection. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Azure resource group - /// - /// - /// Power BI Embedded Workspace Collection name - /// - public static WorkspaceCollection GetByName(this IWorkspaceCollectionsOperations operations, string resourceGroupName, string workspaceCollectionName) - { - return operations.GetByNameAsync(resourceGroupName, workspaceCollectionName).GetAwaiter().GetResult(); - } - - /// - /// Retrieves an existing Power BI Workspace Collection. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Azure resource group - /// - /// - /// Power BI Embedded Workspace Collection name - /// - /// - /// The cancellation token. - /// - public static async Task GetByNameAsync(this IWorkspaceCollectionsOperations operations, string resourceGroupName, string workspaceCollectionName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetByNameWithHttpMessagesAsync(resourceGroupName, workspaceCollectionName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Creates a new Power BI Workspace Collection with the specified properties. - /// A Power BI Workspace Collection contains one or more workspaces, and can be - /// used to provision keys that provide API access to those workspaces. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Azure resource group - /// - /// - /// Power BI Embedded Workspace Collection name - /// - /// - /// Create workspace collection request - /// - public static WorkspaceCollection Create(this IWorkspaceCollectionsOperations operations, string resourceGroupName, string workspaceCollectionName, CreateWorkspaceCollectionRequest body) - { - return operations.CreateAsync(resourceGroupName, workspaceCollectionName, body).GetAwaiter().GetResult(); - } - - /// - /// Creates a new Power BI Workspace Collection with the specified properties. - /// A Power BI Workspace Collection contains one or more workspaces, and can be - /// used to provision keys that provide API access to those workspaces. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Azure resource group - /// - /// - /// Power BI Embedded Workspace Collection name - /// - /// - /// Create workspace collection request - /// - /// - /// The cancellation token. - /// - public static async Task CreateAsync(this IWorkspaceCollectionsOperations operations, string resourceGroupName, string workspaceCollectionName, CreateWorkspaceCollectionRequest body, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CreateWithHttpMessagesAsync(resourceGroupName, workspaceCollectionName, body, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Update an existing Power BI Workspace Collection with the specified - /// properties. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Azure resource group - /// - /// - /// Power BI Embedded Workspace Collection name - /// - /// - /// Update workspace collection request - /// - public static WorkspaceCollection Update(this IWorkspaceCollectionsOperations operations, string resourceGroupName, string workspaceCollectionName, UpdateWorkspaceCollectionRequest body) - { - return operations.UpdateAsync(resourceGroupName, workspaceCollectionName, body).GetAwaiter().GetResult(); - } - - /// - /// Update an existing Power BI Workspace Collection with the specified - /// properties. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Azure resource group - /// - /// - /// Power BI Embedded Workspace Collection name - /// - /// - /// Update workspace collection request - /// - /// - /// The cancellation token. - /// - public static async Task UpdateAsync(this IWorkspaceCollectionsOperations operations, string resourceGroupName, string workspaceCollectionName, UpdateWorkspaceCollectionRequest body, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, workspaceCollectionName, body, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Delete a Power BI Workspace Collection. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Azure resource group - /// - /// - /// Power BI Embedded Workspace Collection name - /// - public static void Delete(this IWorkspaceCollectionsOperations operations, string resourceGroupName, string workspaceCollectionName) - { - operations.DeleteAsync(resourceGroupName, workspaceCollectionName).GetAwaiter().GetResult(); - } - - /// - /// Delete a Power BI Workspace Collection. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Azure resource group - /// - /// - /// Power BI Embedded Workspace Collection name - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this IWorkspaceCollectionsOperations operations, string resourceGroupName, string workspaceCollectionName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, workspaceCollectionName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Verify the specified Power BI Workspace Collection name is valid and not - /// already in use. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Azure location - /// - /// - /// Check name availability request - /// - public static CheckNameResponse CheckNameAvailability(this IWorkspaceCollectionsOperations operations, string location, CheckNameRequest body) - { - return operations.CheckNameAvailabilityAsync(location, body).GetAwaiter().GetResult(); - } - - /// - /// Verify the specified Power BI Workspace Collection name is valid and not - /// already in use. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Azure location - /// - /// - /// Check name availability request - /// - /// - /// The cancellation token. - /// - public static async Task CheckNameAvailabilityAsync(this IWorkspaceCollectionsOperations operations, string location, CheckNameRequest body, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CheckNameAvailabilityWithHttpMessagesAsync(location, body, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } + /// + /// Retrieves an existing Power BI Workspace Collection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Azure resource group + /// + /// + /// Power BI Embedded Workspace Collection name + /// + public static WorkspaceCollection GetByName(this IWorkspaceCollectionsOperations operations, string resourceGroupName, string workspaceCollectionName) + { + return ((IWorkspaceCollectionsOperations)operations).GetByNameAsync(resourceGroupName, workspaceCollectionName).GetAwaiter().GetResult(); + } - /// - /// Retrieves all existing Power BI workspace collections in the specified - /// resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Azure resource group - /// - public static IEnumerable ListByResourceGroup(this IWorkspaceCollectionsOperations operations, string resourceGroupName) + /// + /// Retrieves an existing Power BI Workspace Collection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Azure resource group + /// + /// + /// Power BI Embedded Workspace Collection name + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetByNameAsync(this IWorkspaceCollectionsOperations operations, string resourceGroupName, string workspaceCollectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetByNameWithHttpMessagesAsync(resourceGroupName, workspaceCollectionName, null, cancellationToken).ConfigureAwait(false)) { - return operations.ListByResourceGroupAsync(resourceGroupName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Creates a new Power BI Workspace Collection with the specified properties. + /// A Power BI Workspace Collection contains one or more workspaces, and can be + /// used to provision keys that provide API access to those workspaces. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Azure resource group + /// + /// + /// Power BI Embedded Workspace Collection name + /// + public static WorkspaceCollection Create(this IWorkspaceCollectionsOperations operations, string resourceGroupName, string workspaceCollectionName, CreateWorkspaceCollectionRequest body) + { + return ((IWorkspaceCollectionsOperations)operations).CreateAsync(resourceGroupName, workspaceCollectionName, body).GetAwaiter().GetResult(); + } - /// - /// Retrieves all existing Power BI workspace collections in the specified - /// resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Azure resource group - /// - /// - /// The cancellation token. - /// - public static async Task> ListByResourceGroupAsync(this IWorkspaceCollectionsOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Creates a new Power BI Workspace Collection with the specified properties. + /// A Power BI Workspace Collection contains one or more workspaces, and can be + /// used to provision keys that provide API access to those workspaces. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Azure resource group + /// + /// + /// Power BI Embedded Workspace Collection name + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateAsync(this IWorkspaceCollectionsOperations operations, string resourceGroupName, string workspaceCollectionName, CreateWorkspaceCollectionRequest body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateWithHttpMessagesAsync(resourceGroupName, workspaceCollectionName, body, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.ListByResourceGroupWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Update an existing Power BI Workspace Collection with the specified + /// properties. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Azure resource group + /// + /// + /// Power BI Embedded Workspace Collection name + /// + public static WorkspaceCollection Update(this IWorkspaceCollectionsOperations operations, string resourceGroupName, string workspaceCollectionName, UpdateWorkspaceCollectionRequest body) + { + return ((IWorkspaceCollectionsOperations)operations).UpdateAsync(resourceGroupName, workspaceCollectionName, body).GetAwaiter().GetResult(); + } - /// - /// Retrieves all existing Power BI workspace collections in the specified - /// subscription. - /// - /// - /// The operations group for this extension method. - /// - public static IEnumerable ListBySubscription(this IWorkspaceCollectionsOperations operations) + /// + /// Update an existing Power BI Workspace Collection with the specified + /// properties. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Azure resource group + /// + /// + /// Power BI Embedded Workspace Collection name + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task UpdateAsync(this IWorkspaceCollectionsOperations operations, string resourceGroupName, string workspaceCollectionName, UpdateWorkspaceCollectionRequest body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, workspaceCollectionName, body, null, cancellationToken).ConfigureAwait(false)) { - return operations.ListBySubscriptionAsync().GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Delete a Power BI Workspace Collection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Azure resource group + /// + /// + /// Power BI Embedded Workspace Collection name + /// + public static void Delete(this IWorkspaceCollectionsOperations operations, string resourceGroupName, string workspaceCollectionName) + { + ((IWorkspaceCollectionsOperations)operations).DeleteAsync(resourceGroupName, workspaceCollectionName).GetAwaiter().GetResult(); + } - /// - /// Retrieves all existing Power BI workspace collections in the specified - /// subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The cancellation token. - /// - public static async Task> ListBySubscriptionAsync(this IWorkspaceCollectionsOperations operations, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListBySubscriptionWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Retrieves the primary and secondary access keys for the specified Power BI - /// Workspace Collection. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Azure resource group - /// - /// - /// Power BI Embedded Workspace Collection name - /// - public static WorkspaceCollectionAccessKeys GetAccessKeys(this IWorkspaceCollectionsOperations operations, string resourceGroupName, string workspaceCollectionName) - { - return operations.GetAccessKeysAsync(resourceGroupName, workspaceCollectionName).GetAwaiter().GetResult(); - } + /// + /// Delete a Power BI Workspace Collection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Azure resource group + /// + /// + /// Power BI Embedded Workspace Collection name + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this IWorkspaceCollectionsOperations operations, string resourceGroupName, string workspaceCollectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, workspaceCollectionName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Verify the specified Power BI Workspace Collection name is valid and not + /// already in use. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Azure location + /// + public static CheckNameResponse CheckNameAvailability(this IWorkspaceCollectionsOperations operations, string location, CheckNameRequest body) + { + return ((IWorkspaceCollectionsOperations)operations).CheckNameAvailabilityAsync(location, body).GetAwaiter().GetResult(); + } - /// - /// Retrieves the primary and secondary access keys for the specified Power BI - /// Workspace Collection. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Azure resource group - /// - /// - /// Power BI Embedded Workspace Collection name - /// - /// - /// The cancellation token. - /// - public static async Task GetAccessKeysAsync(this IWorkspaceCollectionsOperations operations, string resourceGroupName, string workspaceCollectionName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Verify the specified Power BI Workspace Collection name is valid and not + /// already in use. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Azure location + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CheckNameAvailabilityAsync(this IWorkspaceCollectionsOperations operations, string location, CheckNameRequest body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CheckNameAvailabilityWithHttpMessagesAsync(location, body, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.GetAccessKeysWithHttpMessagesAsync(resourceGroupName, workspaceCollectionName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Retrieves all existing Power BI workspace collections in the specified + /// resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Azure resource group + /// + public static System.Collections.Generic.IEnumerable ListByResourceGroup(this IWorkspaceCollectionsOperations operations, string resourceGroupName) + { + return ((IWorkspaceCollectionsOperations)operations).ListByResourceGroupAsync(resourceGroupName).GetAwaiter().GetResult(); + } - /// - /// Regenerates the primary or secondary access key for the specified Power BI - /// Workspace Collection. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Azure resource group - /// - /// - /// Power BI Embedded Workspace Collection name - /// - /// - /// Access key to regenerate - /// - public static WorkspaceCollectionAccessKeys RegenerateKey(this IWorkspaceCollectionsOperations operations, string resourceGroupName, string workspaceCollectionName, WorkspaceCollectionAccessKey body) + /// + /// Retrieves all existing Power BI workspace collections in the specified + /// resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Azure resource group + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListByResourceGroupAsync(this IWorkspaceCollectionsOperations operations, string resourceGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListByResourceGroupWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) { - return operations.RegenerateKeyAsync(resourceGroupName, workspaceCollectionName, body).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Retrieves all existing Power BI workspace collections in the specified + /// subscription. + /// + /// + /// The operations group for this extension method. + /// + public static System.Collections.Generic.IEnumerable ListBySubscription(this IWorkspaceCollectionsOperations operations) + { + return ((IWorkspaceCollectionsOperations)operations).ListBySubscriptionAsync().GetAwaiter().GetResult(); + } - /// - /// Regenerates the primary or secondary access key for the specified Power BI - /// Workspace Collection. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Azure resource group - /// - /// - /// Power BI Embedded Workspace Collection name - /// - /// - /// Access key to regenerate - /// - /// - /// The cancellation token. - /// - public static async Task RegenerateKeyAsync(this IWorkspaceCollectionsOperations operations, string resourceGroupName, string workspaceCollectionName, WorkspaceCollectionAccessKey body, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Retrieves all existing Power BI workspace collections in the specified + /// subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListBySubscriptionAsync(this IWorkspaceCollectionsOperations operations, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListBySubscriptionWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.RegenerateKeyWithHttpMessagesAsync(resourceGroupName, workspaceCollectionName, body, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Retrieves the primary and secondary access keys for the specified Power BI + /// Workspace Collection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Azure resource group + /// + /// + /// Power BI Embedded Workspace Collection name + /// + public static WorkspaceCollectionAccessKeys GetAccessKeys(this IWorkspaceCollectionsOperations operations, string resourceGroupName, string workspaceCollectionName) + { + return ((IWorkspaceCollectionsOperations)operations).GetAccessKeysAsync(resourceGroupName, workspaceCollectionName).GetAwaiter().GetResult(); + } - /// - /// Migrates an existing Power BI Workspace Collection to a different resource - /// group and/or subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Azure resource group - /// - /// - /// Workspace migration request - /// - public static void Migrate(this IWorkspaceCollectionsOperations operations, string resourceGroupName, MigrateWorkspaceCollectionRequest body) + /// + /// Retrieves the primary and secondary access keys for the specified Power BI + /// Workspace Collection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Azure resource group + /// + /// + /// Power BI Embedded Workspace Collection name + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAccessKeysAsync(this IWorkspaceCollectionsOperations operations, string resourceGroupName, string workspaceCollectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetAccessKeysWithHttpMessagesAsync(resourceGroupName, workspaceCollectionName, null, cancellationToken).ConfigureAwait(false)) { - operations.MigrateAsync(resourceGroupName, body).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Regenerates the primary or secondary access key for the specified Power BI + /// Workspace Collection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Azure resource group + /// + /// + /// Power BI Embedded Workspace Collection name + /// + public static WorkspaceCollectionAccessKeys RegenerateKey(this IWorkspaceCollectionsOperations operations, string resourceGroupName, string workspaceCollectionName, WorkspaceCollectionAccessKey body) + { + return ((IWorkspaceCollectionsOperations)operations).RegenerateKeyAsync(resourceGroupName, workspaceCollectionName, body).GetAwaiter().GetResult(); + } - /// - /// Migrates an existing Power BI Workspace Collection to a different resource - /// group and/or subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Azure resource group - /// - /// - /// Workspace migration request - /// - /// - /// The cancellation token. - /// - public static async Task MigrateAsync(this IWorkspaceCollectionsOperations operations, string resourceGroupName, MigrateWorkspaceCollectionRequest body, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Regenerates the primary or secondary access key for the specified Power BI + /// Workspace Collection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Azure resource group + /// + /// + /// Power BI Embedded Workspace Collection name + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task RegenerateKeyAsync(this IWorkspaceCollectionsOperations operations, string resourceGroupName, string workspaceCollectionName, WorkspaceCollectionAccessKey body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.RegenerateKeyWithHttpMessagesAsync(resourceGroupName, workspaceCollectionName, body, null, cancellationToken).ConfigureAwait(false)) { - (await operations.MigrateWithHttpMessagesAsync(resourceGroupName, body, null, cancellationToken).ConfigureAwait(false)).Dispose(); + return _result.Body; } + } + /// + /// Migrates an existing Power BI Workspace Collection to a different resource + /// group and/or subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Azure resource group + /// + public static void Migrate(this IWorkspaceCollectionsOperations operations, string resourceGroupName, MigrateWorkspaceCollectionRequest body) + { + ((IWorkspaceCollectionsOperations)operations).MigrateAsync(resourceGroupName, body).GetAwaiter().GetResult(); + } - /// - /// Delete a Power BI Workspace Collection. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Azure resource group - /// - /// - /// Power BI Embedded Workspace Collection name - /// - public static void BeginDelete(this IWorkspaceCollectionsOperations operations, string resourceGroupName, string workspaceCollectionName) - { - operations.BeginDeleteAsync(resourceGroupName, workspaceCollectionName).GetAwaiter().GetResult(); - } - - /// - /// Delete a Power BI Workspace Collection. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Azure resource group - /// - /// - /// Power BI Embedded Workspace Collection name - /// - /// - /// The cancellation token. - /// - public static async Task BeginDeleteAsync(this IWorkspaceCollectionsOperations operations, string resourceGroupName, string workspaceCollectionName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, workspaceCollectionName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } + /// + /// Migrates an existing Power BI Workspace Collection to a different resource + /// group and/or subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Azure resource group + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task MigrateAsync(this IWorkspaceCollectionsOperations operations, string resourceGroupName, MigrateWorkspaceCollectionRequest body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.MigrateWithHttpMessagesAsync(resourceGroupName, body, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Delete a Power BI Workspace Collection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Azure resource group + /// + /// + /// Power BI Embedded Workspace Collection name + /// + public static void BeginDelete(this IWorkspaceCollectionsOperations operations, string resourceGroupName, string workspaceCollectionName) + { + ((IWorkspaceCollectionsOperations)operations).BeginDeleteAsync(resourceGroupName, workspaceCollectionName).GetAwaiter().GetResult(); + } + /// + /// Delete a Power BI Workspace Collection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Azure resource group + /// + /// + /// Power BI Embedded Workspace Collection name + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginDeleteAsync(this IWorkspaceCollectionsOperations operations, string resourceGroupName, string workspaceCollectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, workspaceCollectionName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } } } diff --git a/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/WorkspacesOperations.cs b/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/WorkspacesOperations.cs index 909ada372186..06a14911f9bb 100644 --- a/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/WorkspacesOperations.cs +++ b/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/WorkspacesOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.PowerBIEmbedded { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// WorkspacesOperations operations. /// - internal partial class WorkspacesOperations : IServiceOperations, IWorkspacesOperations + internal partial class WorkspacesOperations : Microsoft.Rest.IServiceOperations, IWorkspacesOperations { /// /// Initializes a new instance of the WorkspacesOperations class. @@ -36,13 +24,13 @@ internal partial class WorkspacesOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal WorkspacesOperations(PowerBIEmbeddedManagementClient client) + internal WorkspacesOperations (PowerBIEmbeddedManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -66,13 +54,13 @@ internal WorkspacesOperations(PowerBIEmbeddedManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -81,71 +69,82 @@ internal WorkspacesOperations(PowerBIEmbeddedManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, string workspaceCollectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string workspaceCollectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (workspaceCollectionName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "workspaceCollectionName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "workspaceCollectionName"); } - if (Client.ApiVersion == null) + + if (this.Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("workspaceCollectionName", workspaceCollectionName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBI/workspaceCollections/{workspaceCollectionName}/workspaces").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{workspaceCollectionName}", System.Uri.EscapeDataString(workspaceCollectionName)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -157,50 +156,51 @@ internal WorkspacesOperations(PowerBIEmbeddedManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - Error _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + Error _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -210,9 +210,10 @@ internal WorkspacesOperations(PowerBIEmbeddedManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -223,24 +224,28 @@ internal WorkspacesOperations(PowerBIEmbeddedManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/WorkspacesOperationsExtensions.cs b/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/WorkspacesOperationsExtensions.cs index 0eb4fc09b661..b77425b76938 100644 --- a/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/WorkspacesOperationsExtensions.cs +++ b/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/Generated/WorkspacesOperationsExtensions.cs @@ -1,69 +1,57 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.PowerBIEmbedded { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for WorkspacesOperations. + /// Extension methods for WorkspacesOperations /// public static partial class WorkspacesOperationsExtensions { - /// - /// Retrieves all existing Power BI workspaces in the specified workspace - /// collection. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Azure resource group - /// - /// - /// Power BI Embedded Workspace Collection name - /// - public static IEnumerable List(this IWorkspacesOperations operations, string resourceGroupName, string workspaceCollectionName) - { - return operations.ListAsync(resourceGroupName, workspaceCollectionName).GetAwaiter().GetResult(); - } + /// + /// Retrieves all existing Power BI workspaces in the specified workspace + /// collection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Azure resource group + /// + /// + /// Power BI Embedded Workspace Collection name + /// + public static System.Collections.Generic.IEnumerable List(this IWorkspacesOperations operations, string resourceGroupName, string workspaceCollectionName) + { + return ((IWorkspacesOperations)operations).ListAsync(resourceGroupName, workspaceCollectionName).GetAwaiter().GetResult(); + } - /// - /// Retrieves all existing Power BI workspaces in the specified workspace - /// collection. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Azure resource group - /// - /// - /// Power BI Embedded Workspace Collection name - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this IWorkspacesOperations operations, string resourceGroupName, string workspaceCollectionName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Retrieves all existing Power BI workspaces in the specified workspace + /// collection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Azure resource group + /// + /// + /// Power BI Embedded Workspace Collection name + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this IWorkspacesOperations operations, string resourceGroupName, string workspaceCollectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, workspaceCollectionName, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, workspaceCollectionName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } - + } } } diff --git a/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/README.md b/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/README.md index ab1842ba5c95..5c3bd32b65fe 100644 --- a/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/README.md +++ b/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/README.md @@ -5,19 +5,20 @@ This directory contains management plane service clients of Az.Storage module. In this directory, run AutoRest: ``` autorest --reset -autorest --use:@microsoft.azure/autorest.csharp@2.3.90 -autorest.cmd README.md --version=v2 +autorest --use:@autorest/powershell@4.x ``` ### AutoRest Configuration > see https://aka.ms/autorest ``` yaml -csharp: true +isSdkGenerator: true +powershell: true clear-output-folder: true reflect-api-versions: true openapi-type: arm azure-arm: true license-header: MICROSOFT_MIT_NO_VERSION +title: PowerBIEmbeddedManagementClient ``` From acf52a2ff26fa30e53b0dd9eb0c0bbbc64dffcd9 Mon Sep 17 00:00:00 2001 From: JoyerJin <116236375+JoyerJin@users.noreply.github.com> Date: Thu, 21 Nov 2024 12:07:47 +0800 Subject: [PATCH 3/3] PowerBIEmbedded change log --- src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/README.md | 2 +- src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/README.md | 2 +- src/PowerBIEmbedded/PowerBIEmbedded/ChangeLog.md | 2 ++ 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/README.md b/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/README.md index 1ec7f6e08ec7..63a86fab14dd 100644 --- a/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/README.md +++ b/src/PowerBIEmbedded/PowerBIDedicated.Management.Sdk/README.md @@ -1,5 +1,5 @@ # Overall -This directory contains management plane service clients of Az.Storage module. +This directory contains PowerBI Dedicated management plane service clients of Az.PowerBIEmbedded module. ## Run Generation In this directory, run AutoRest: diff --git a/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/README.md b/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/README.md index 5c3bd32b65fe..ebcc6633f99d 100644 --- a/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/README.md +++ b/src/PowerBIEmbedded/PowerBIEmbedded.Management.Sdk/README.md @@ -1,5 +1,5 @@ # Overall -This directory contains management plane service clients of Az.Storage module. +This directory contains PowerBI Embedded management plane service clients of Az.PowerBIEmbedded module. ## Run Generation In this directory, run AutoRest: diff --git a/src/PowerBIEmbedded/PowerBIEmbedded/ChangeLog.md b/src/PowerBIEmbedded/PowerBIEmbedded/ChangeLog.md index 7bf562ff533f..6ce6e78ba25d 100644 --- a/src/PowerBIEmbedded/PowerBIEmbedded/ChangeLog.md +++ b/src/PowerBIEmbedded/PowerBIEmbedded/ChangeLog.md @@ -18,6 +18,8 @@ - Additional information about change #1 --> ## Upcoming Release +* Removed "Microsoft.Azure.Management.PowerBIEmbedded" Version "1.1.1-preview" PackageReference +* Removed "Microsoft.Azure.Management.PowerBIDedicated" Version "0.11.0-preview" PackageReference ## Version 2.0.0 * Removed deprecated workspace collection cmdlets